# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
152994 | 2019-09-11T05:39:46 Z | junodeveloper | Exhibition (JOI19_ho_t2) | C++14 | 2 ms | 256 KB |
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define all(x) (x).begin(), (x).end() #define fi first #define se second using namespace std; typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; int n,m,C[100010]; pii a[100010]; bool F(int x) { int i,j=m-x; for(i=0;i<n;i++) { if(j==m) break; if(a[i].se<=C[j]) j++; } return j==m; } int main() { scanf("%d%d",&n,&m); int i; for(i=0;i<n;i++) scanf("%d%d",&a[i].se,&a[i].fi); for(i=0;i<m;i++) scanf("%d",C+i); sort(a,a+n); int lo=0,hi=min(n,m); while(lo<hi) { int mid=(lo+hi+1)/2; if(F(mid)) lo=mid; else hi=mid-1; } printf("%d",lo); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 252 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 252 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 252 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |