# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
795740 |
2023-07-27T14:00:39 Z |
makanhulia |
Radio (COCI22_radio) |
C++17 |
|
37 ms |
10188 KB |
#include<bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int n, m; cin >> n >> m;
set<pair<int, int>, greater<pair<int, int>>> a;
set<pair<int, int>> b;
vector<bool> dead(n);
deque<int> c(m);
for(int i=0; i<n; i++) {
int in; cin >> in;
a.insert({in, i});
}
for(int i=0; i<n; i++) {
int in; cin >> in;
b.insert({in, i});
}
for(int &p : c) cin >> p;
sort(c.begin(), c.end()); int ans=0;
for(auto [p, i] : a) {
if(c.empty()) break;
if(p>c.back()) continue;
dead[i]=1;
ans++; c.pop_back();
}
for(auto [p, i] : b) {
if(c.empty()) break;
if(dead[i]) continue;
if(p<c.front()) continue;
ans++; c.pop_front();
}
cout << ans << '\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
10188 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |