#include <iostream>
#include <algorithm>
using namespace std;
struct painting
{
int s;
int v;
};
bool operator < (painting A, painting B)
{
return A.v < B.v;
}
int main()
{
int N, M;
cin >> N >> M;
painting P[N+1];
for(int i = 1; i <= N; i++) cin >> P[i].s >> P[i].v;
sort(P+1, P+N+1);
int C[M+1];
for(int i = 1; i <= M; i++) cin >> C[i];
sort(C+1, C+M+1);
int x = M;
for(int i = N; i >= 1; i--)
{
if(P[i].s <= C[x]) x--;
if(x == 0) break;
}
cout << M-x << '\n';
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
5 ms |
256 KB |
Output is correct |
2 |
Correct |
5 ms |
256 KB |
Output is correct |
3 |
Incorrect |
5 ms |
376 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |