# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1023888 | vjudge1 | Exhibition (JOI19_ho_t2) | C++17 | 38 ms | 4188 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
const int N = 1e6+5;
#define pii pair<int, int>
#define fi first
#define se second
int n, m, c[N];
pii a[N];
void sol() {
cin >> n >> m;
for (int i = 1; i <= n; ++i) cin >> a[i].fi >> a[i].se;
for (int i = 1; i <= m; ++i) cin >> c[i];
sort(c+1, c+m+1);
sort(a+1, a+n+1, [&](pii &p1, pii &p2) -> bool {
if (p1==p2) return 0;
else if (p1.se == p2.se) return p1.fi < p2.fi;
else return p1.se < p2.se;
});
int j = m;
for (int i = n; min(i, j) >= 1; --i)
if (a[i].fi <= c[j])
j--;
cout << m-j;
}
signed main() {
cin.tie(0) -> sync_with_stdio(0);
if (fopen("A.inp", "r")) freopen("A.inp", "r", stdin);
int tc = 1; // cin >> tc;
for (int test = 1; test <= tc; ++test) sol();
}
컴파일 시 표준 에러 (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... |