# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
666848 |
2022-11-29T19:39:12 Z |
divad |
Exhibition (JOI19_ho_t2) |
C++14 |
|
1 ms |
212 KB |
#include <iostream>
#include <algorithm>
#define MAX 100002
#define f first
#define s second
using namespace std;
int n,m,c[MAX];
pair<int, int> pic[MAX];
int main()
{
cin >> n >> m;
for(int i = 1; i <= n; i++){
cin >> pic[i].s >> pic[i].f;
}
for(int i = 1; i <= m; i++){
cin >> c[i];
}
sort(c+1, c+m+1);
sort(pic+1, pic+n+1);
int pos1 = n, pos2 = m;
/// pos1 = pozitie poza
/// pos2 = pozitie chenar
int ans = 0;
while(pos2 >= 0 && pos1 >= 0){
if(pic[pos1].s <= c[pos2]){
pos1--;
ans++;
}
pos2--;
}
cout << ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |