Submission #129399

#TimeUsernameProblemLanguageResultExecution timeMemory
129399gaoxam123Exhibition (JOI19_ho_t2)C++14
100 / 100
65 ms2808 KiB
#include<bits/stdc++.h> using namespace std; #pragma GCC Optimize (O3) #pragma GCC targets (sse4) #define int long long int n,m,ans; pair<int,int> a[100005]; int c[100005]; signed main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>m; for(int i=1;i<=n;i++){ cin>>a[i].second>>a[i].first; } for(int i=1;i<=m;i++){ cin>>c[i]; } int cnt=n; sort(a+1,a+n+1); sort(c+1,c+m+1); for(int i=m;i>=1;i--){ while(cnt>0&&a[cnt].second>c[i]){ cnt--; } if(cnt){ ans++; cnt--; } } cout<<ans; }

Compilation message (stderr)

joi2019_ho_t2.cpp:3:0: warning: ignoring #pragma GCC Optimize [-Wunknown-pragmas]
 #pragma GCC Optimize (O3)
 
joi2019_ho_t2.cpp:4:0: warning: ignoring #pragma GCC targets [-Wunknown-pragmas]
 #pragma GCC targets (sse4)
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...