# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129382 | 2019-07-12T07:36:32 Z | hungcung | Exhibition (JOI19_ho_t2) | C++17 | 2 ms | 376 KB |
#include<bits/stdc++.h> #define fi first #define se second using namespace std; int n,m,c[100005],dem,ans; pair<int,int> a[100005]; bool cmp(pair<int,int> &x,pair<int,int> &y){ return x.se<y.se; } signed main(){ scanf("%d %d",&n,&m); for(int i=1;i<=n;i++){ scanf("%d %d",&a[i].fi,&a[i].se); } for(int i=1;i<=m;i++){ scanf("%d",&c[i]); } sort(a+1,a+n+1,cmp); sort(c+1,c+m+1); dem=n; for(int i=m;i>0;i--){ while(dem>0&&a[dem].fi>c[i]){ dem--; } if(dem>0){ ans++; dem--; } } printf("%d",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |