Submission #213327

#TimeUsernameProblemLanguageResultExecution timeMemory
213327anubhavdharExhibition (JOI19_ho_t2)C++14
100 / 100
85 ms5680 KiB
#include<bits/stdc++.h> #define ll long long int #define pb push_back #define mp make_pair #define FOR(i,n) for(i=0;i<(n);i++) #define FORe(i,n) for(i=1;i<=(n);i++) #define FORr(i,a,b) for(i=(a);i<(b);i++) #define ii pair<ll,ll> #define vi vector<ll> #define vii vector<ii> #define ff first #define ss second #define cd complex<double> #define vcd vector<cd> #define ldd long double #define all(x) (x).begin(),(x).end() using namespace std; const short int __PRECISION = 10; const ll MOD = 1e9+7; const ll INF = 1e17 + 1101; const ll LOGN = 17; const ll MAXN = 2e5+5; const ll ROOTN = 320; const ldd PI = acos(-1); const ldd EPS = 1e-7; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); ll N,M,i,j,k,ans = 0; cin>>N>>M; ll C[M]; ii P[N]; FOR(i,N) { cin>>j>>k; P[i] = mp(k,j); } FOR(i,M) cin>>C[i]; sort(C,C+M); sort(P,P+N); j = M-1; i = N-1; while(j>=0 and i>=0) { if(C[j] >= P[i].ss) { ans++; j--; i--; } else i--; } cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...