#include <bits/stdc++.h>
using namespace std;
int main()
{
int n,m;
cin >> n >> m;
vector<pair<int,int> > slika(n);
vector<int> ramka(m);
for (int i=0;i<n;i++)
cin >> slika[i].second >> slika[i].first;
for (int i=0;i<m;i++)
cin >> ramka[i];
sort(slika.begin(),slika.end());
sort(ramka.begin(),ramka.end());
int index=0,vk=0;
for (int i=0;i<n;)
{
if (index==m) break;
if (ramka[index]<slika[i].second) index++;
else index++,i++,vk++;
}
cout << vk << endl;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
300 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
300 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
300 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |