QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#744141 | #8988. Dishonest Lottery | t-aswath | AC ✓ | 3ms | 3880kb | C++14 | 1.4kb | 2024-11-13 20:59:13 | 2024-11-13 20:59:15 |
Judging History
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define deb(x...) 42
#endif
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
void solve(int t) {
ll n;
cin>>n;
map<ll,ll>mp;
for(ll i=0;i<(10*n*5);i++){
ll x;
cin>>x;
mp[x]++;
}
vector<ll>ans;
for(auto x:mp){
if(x.S>2*n) ans.push_back(x.F);
}
if(ans.size()==0){
cout<<"-1\n";
return;
}
else{
for(ll i=0;i<ans.size();i++){
cout<<ans[i]<<" ";
}
cout<<endl;
}
}
int main() {
fast_io;
#ifdef LOCAL
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("output.txt", "w", stderr);
#endif
ll t = 1;
// cin >> t;
for(ll i = 0; i < t; i++) {
#ifdef LOCAL
cout << "CASE " << i + 1 << ":\n";
#endif
solve(i);
}
#ifdef LOCAL
cout << endl << "Finished in " << clock() * 1.0 / CLOCKS_PER_SEC << " sec\n\n";
#endif
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3816kb
input:
1 32 30 16 45 27 34 45 35 31 42 1 12 26 50 13 34 50 36 21 39 47 7 41 18 45 28 48 2 8 4 16 40 17 2 19 50 4 30 15 6 31 13 33 46 18 49 23 24 17 48
output:
45 50
result:
ok single line: '45 50 '
Test #2:
score: 0
Accepted
time: 0ms
memory: 3820kb
input:
1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
output:
-1
result:
ok single line: '-1'
Test #3:
score: 0
Accepted
time: 2ms
memory: 3660kb
input:
1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 1 2 3 4 5 6 7...
output:
-1
result:
ok single line: '-1'
Test #4:
score: 0
Accepted
time: 2ms
memory: 3620kb
input:
1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 1 2 3 4 5 6 7 8 9 10 11 12 13 1...
output:
-1
result:
ok single line: '-1'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3592kb
input:
1000 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1...
output:
1 2 3 4 5 6 7 8 9 10
result:
ok single line: '1 2 3 4 5 6 7 8 9 10 '
Test #6:
score: 0
Accepted
time: 2ms
memory: 3604kb
input:
1000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
result:
ok single line: '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 '
Test #7:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
1000 5 8 6 9 7 4 1 5 2 3 19 20 21 18 22 14 16 15 13 12 24 21 1 22 23 21 20 23 24 22 24 3 2 4 1 6 7 8 10 9 1 24 3 2 23 18 20 17 21 19 11 10 9 7 8 20 19 22 23 21 5 7 6 3 4 8 6 7 5 9 7 9 10 6 8 23 21 24 1 22 9 11 12 10 13 18 15 17 16 19 23 24 2 1 22 20 24 21 23 22 2 1 23 3 24 24 4 2 3 1 18 17 16 19 15 ...
output:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
result:
ok single line: '1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 '
Test #8:
score: 0
Accepted
time: 3ms
memory: 3564kb
input:
1000 12 27 36 44 37 38 34 16 3 35 33 42 4 38 35 19 6 10 44 47 3 17 12 16 14 40 6 14 3 30 45 9 33 22 38 18 1 35 49 4 46 2 34 31 38 29 3 25 22 26 45 13 42 47 39 1 15 35 18 33 40 32 35 14 41 39 30 1 29 6 11 21 38 10 22 38 13 14 29 49 21 28 29 7 49 24 5 20 30 15 32 46 16 5 29 20 5 50 1 35 40 46 44 33 47...
output:
-1
result:
ok single line: '-1'
Test #9:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
1000 7 36 25 34 41 44 7 2 12 35 33 11 12 8 32 41 18 13 40 3 26 40 36 10 45 44 17 36 42 24 1 39 21 30 50 37 16 36 17 35 49 10 44 13 6 42 46 18 6 35 15 11 2 40 47 37 47 40 42 21 40 17 16 44 8 24 28 41 44 13 21 13 36 41 10 18 43 35 10 34 31 11 48 14 27 4 21 46 15 8 40 31 39 12 21 31 35 24 5 16 39 25 48...
output:
-1
result:
ok single line: '-1'
Test #10:
score: 0
Accepted
time: 3ms
memory: 3572kb
input:
1000 21 33 9 34 46 41 11 27 5 18 4 2 50 21 30 49 15 31 24 13 42 49 16 18 40 37 18 29 4 27 39 1 7 45 30 16 50 18 38 49 34 21 3 13 49 47 46 50 35 25 16 41 7 50 2 31 44 5 35 21 4 31 46 11 40 29 8 35 39 17 3 11 22 2 30 11 3 34 48 27 46 12 36 24 16 1 12 3 15 9 30 4 28 47 38 42 18 15 29 24 6 42 41 8 24 35...
output:
-1
result:
ok single line: '-1'
Test #11:
score: 0
Accepted
time: 3ms
memory: 3616kb
input:
1000 8 5 17 50 38 9 50 46 10 31 46 32 42 23 9 3 32 23 30 38 16 38 1 30 2 8 31 18 33 36 46 26 19 30 42 41 17 15 5 3 15 49 5 18 28 41 6 31 37 24 32 34 28 39 2 44 8 34 48 13 39 13 41 22 19 38 4 13 11 12 2 33 13 22 7 6 44 1 26 19 45 37 44 6 24 37 43 3 49 13 6 40 19 38 8 15 32 7 2 47 5 2 38 12 42 38 47 3...
output:
-1
result:
ok single line: '-1'
Test #12:
score: 0
Accepted
time: 3ms
memory: 3568kb
input:
1000 41 34 10 40 39 32 45 41 24 23 42 15 34 1 43 45 30 4 11 27 12 14 23 4 21 33 5 36 21 32 36 43 32 20 27 10 11 32 40 44 45 40 27 29 7 24 10 19 25 40 43 40 6 30 18 27 16 47 28 7 38 43 7 3 34 15 37 16 4 13 40 8 45 35 41 8 11 10 4 16 20 14 3 25 17 33 24 6 29 4 14 6 3 33 17 38 9 11 21 37 11 38 18 34 2 ...
output:
-1
result:
ok single line: '-1'
Test #13:
score: 0
Accepted
time: 3ms
memory: 3880kb
input:
1000 41 32 4 19 25 31 19 26 43 41 19 30 42 3 5 19 11 20 49 40 3 19 5 33 23 36 49 19 50 42 19 30 33 13 37 19 50 18 35 29 30 19 20 8 44 40 19 26 25 29 14 19 2 23 11 39 32 19 33 37 7 20 22 19 34 1 11 3 19 4 27 23 28 32 19 15 18 42 44 19 20 30 19 31 33 1 30 15 48 19 1 19 21 37 49 35 19 8 6 17 31 9 7 19 ...
output:
19
result:
ok single line: '19 '