# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
200401 | 2020-02-06T16:34:39 Z | blue | Exhibition (JOI19_ho_t2) | C++14 | 0 ms | 0 KB |
#include <iostream> #include <algorithm> using namespace std; struct painting { int s; int v; }; bool operator < (painting A, painting B) { if(A.v == B.v) return A.s < B.s; return A.v < B.v; } int main() { int N, M; cin >> N >> M; painting P[N+1]; for(int i = 1; i <= N; i++) cin >> P[i].s >> P[i].v; sort(P+1, P+N+1); int C[M+1]; for(int i = 1; i <= M; i++) cin >> C[i]; sort(C+1, C+M+1); int j = M; for(int i = N; i >= 1; i--) { if(P[i].s <= C[j]) j--; if(x == 0) break; } cout << M-j << '\n'; return 0; }