이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
#define all(x) x.begin(),x.end()
typedef pair<pi,int> pp;
#define p(x,y,z) pp(pi(x,y),z)
const int maxn = 100010;
int n,m;
priority_queue <int, vector<int>,greater<int>> pq;
int32_t main() {
cin >> n >> m;
vector <pi> paints(n);
vector <int> frames(m);
for (int i =0;i<n;i++) {
cin >> paints[i].s >> paints[i].f;
}
for (int i =0;i<m;i++) {
cin >> frames[i];
}
sort(frames.rbegin(),frames.rend());
sort(paints.rbegin(),paints.rend());
int index = 0,ans=0;
for (int i =0;i<m;i++) {
while (index != n and paints[index].s > frames[i]) {
index++;
}
if (index == n) break;
ans++;
index++;
}
cout << ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |