# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
99012 | 2019-02-28T05:30:39 Z | 크리(#2856, kriii) | Exhibition (JOI19_ho_t2) | C++17 | 2 ms | 384 KB |
#include <stdio.h> #include <algorithm> #include <map> using namespace std; int N,M,C; pair<int, int> pic[100100]; int sz[100100],bit[100100]; int out(int x) { int r = 0; while (x){ r = max(r,bit[x]); x -= x & (-x); } return r; } void in(int x, int p) { while (x <= C){ bit[x] = max(bit[x],p); x += x & (-x); } } int main() { scanf ("%d %d",&N,&M); for (int i=0;i<N;i++){ scanf ("%d %d",&pic[i].second,&pic[i].first); pic[i].first = -pic[i].first; } sort(pic,pic+N); for (int i=0;i<N;i++){ int x = C + 1; if (pic[i].first != pic[i+1].first) C++; pic[i].first = x; } for (int i=0;i<M;i++) scanf ("%d",&sz[i]); sort(sz,sz+M); for (int i=0;i<N;i++){ int u = out(pic[i].first) + 1; int v = M - (lower_bound(sz,sz+M,pic[i].second) - sz); in(pic[i].first,min(u,v)); } printf ("%d\n",out(C)); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Incorrect | 2 ms | 384 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |