이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define MS(x,y) memset((x),(y),sizeof((x)))
#define MN 1000000007
using namespace std;
const int MAXN = 1001;
vector<int> frames;
vector<pair<int,int>> pics;
int n,m;
int main()
{
#if LOCAL_DEBUG
fstream cin("in.txt");
#endif
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin>>n>>m;
pics.resize(n);
for (int i = 0; i<n; i++) cin>>pics[i].second>>pics[i].first;
sort(pics.rbegin(),pics.rend());
frames.resize(m);
for (int i = 0; i<m; i++) cin>>frames[i];
sort(frames.rbegin(),frames.rend());
int ctr = 0;
for (int i = 0; i<n; i++) {
if (ctr >= m) break;
if (frames[ctr] >= pics[i].second) ctr++;
}
cout<<ctr<<endl;
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... |