이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ar array
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
signed main(void) {
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifdef LOCAL
freopen("A.INP", "r", stdin);
freopen("A.OUT", "w", stdout);
#endif // LOCAL
int n, m; cin >> n >> m;
vector<ii> pictures(n);
vector<int> frames(m);
for (auto & it : pictures) {
cin >> it.se >> it.fi;
}
for (auto & it : frames) {
cin >> it;
}
sort(pictures.begin(), pictures.end());
sort(frames.begin(), frames.end());
int cur = n - 1, res = 0;
for (int i = m - 1; i >= 0; --i) {
while (pictures[cur].se > frames[i]) {
--cur;
}
if (cur >= 0) {
++res;
--cur;
}
}
cout << res;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |