# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
995628 | rsinventor | Exhibition (JOI19_ho_t2) | C++17 | 0 ms | 348 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector <string> vs;
typedef vector<char> vc;
typedef pair<int, int> pii;
typedef vector <pii> vpii;
#define all(a) (a).begin(), (a).end()
#define pb push_back
#define ins insert
#define endl "\n"
bool cmp(pii a, pii b) {
if(a.second==b.second) {
return a.first<b.first;
}
return a.second<b.second;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vpii pics(n);
for(int i = 0; i < n; i++) {
cin >> pics[i].first >> pics[i].second;
}
vi frames(m);
for(int i = 0; i < m; i++) {
cin >> frames[i];
}
sort(all(frames));
sort(all(pics), cmp);
int i = 0;
int j = 0;
int ans = 0;
while(i<pics.size() && j<frames.size()) {
if(pics[i].first>frames[j]) {
j++;
} else {
i++;
j++;
ans++;
}
}
cout << ans << endl;
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |