#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
vector<array<int,2>>v(n);
vector<int>c(m);
for(int i=0;i<n;i++)cin>>v[i][1]>>v[i][0];
for(int i=0;i<m;i++)cin>>c[i];
sort(c.begin(),c.end());
for(int i=0;i<n;i++)v[i][1] = m - (lower_bound(c.begin(),c.end(),v[i][1]) - c.begin());
sort(v.begin(),v.end());
int ans = 0;
for(int i=n-1;i>=0;i--){
if(ans+1 <= v[i][1])ans++;
}
cout<<ans;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
292 KB |
Output is correct |
2 |
Correct |
0 ms |
292 KB |
Output is correct |
3 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
292 KB |
Output is correct |
2 |
Correct |
0 ms |
292 KB |
Output is correct |
3 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
292 KB |
Output is correct |
2 |
Correct |
0 ms |
292 KB |
Output is correct |
3 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |