# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
121051 | 2019-06-26T04:09:13 Z | 이온조(#2969) | Exhibition (JOI19_ho_t2) | C++14 | 2 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; int S[100009], V[100009], C[100009]; int main() { int N, M; scanf("%d%d",&N,&M); for(int i=1; i<=N; i++) scanf("%d%d",&S[i],&V[i]); for(int i=1; i<=M; i++) scanf("%d",&C[i]); sort(C+1, C+M+1); vector<int> T; for(int i=1; i<=N; i++) { S[i] = lower_bound(C+1, C+M+1, S[i]) - C; if(S[i] <= M) T.push_back(i); } sort(T.begin(), T.end(), [&](int P, int Q) { if(V[P] == V[Q]) return S[P] < S[Q]; return V[P] < V[Q]; }); int ans = 0; priority_queue<int> pq; for(int oi=0, s=0; oi<T.size(); oi++) { int i = T[oi]; ++s; ans = max(ans, s); pq.push(S[i] - oi); while(pq.size() && pq.top() == M - oi) { --s; pq.pop(); } } printf("%d", ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 356 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Incorrect | 2 ms | 384 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 356 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Incorrect | 2 ms | 384 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 356 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Incorrect | 2 ms | 384 KB | Output isn't correct |
8 | Halted | 0 ms | 0 KB | - |