이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
#define ii pair<int, int>
#define f1 first
#define s2 second
int main()
{
ios :: sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m;
cin >> n >> m;
vector<ii> pict(n);
vector<int> frame(m);
for (ii &x : pict)
cin >> x.s2 >> x.f1;
for (int &x : frame)
cin >> x;
sort(pict.begin(), pict.end(), greater<ii>());
sort(frame.begin(), frame.end(), greater<int>());
int res = 0, idx = 0;
for (int x : frame)
{
while (idx < n && pict[idx].s2 > x)
idx++;
if (idx < n)
res++, idx++;
}
cout << res << '\n';
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |