#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;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |
# |
결과 |
실행 시간 |
메모리 |
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 |
- |