# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
522651 | Monarchuwu | Exhibition (JOI19_ho_t2) | C++17 | 54 ms | 1536 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.
// sort các tranh giảm theo V, bằng V giảm S
// sort các khung giảm theo C
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
#define ff first
#define ss second
const int N = 1e5 + 9;
int n, m;
pii a[N];
int c[N];
int main() {
cin.tie(NULL)->sync_with_stdio(false);
cin >> n >> m;
for (int i = 1; i <= n; ++i) cin >> a[i].ss >> a[i].ff;
for (int i = 1; i <= m; ++i) cin >> c[i];
sort(a + 1, a + n + 1, greater<pii>());
sort(c + 1, c + m + 1, greater<int>());
int ans(0);
for (int i = 1, p; i <= n && ans < m; ++i)
if (c[ans + 1] >= a[i].ss) ++ans; // cho dùng khung thứ ans+1
cout << ans << '\n';
}
/** /\_/\
* (= ._.)
* / >0 \>1
**/
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... |