Submission #1083454

#TimeUsernameProblemLanguageResultExecution timeMemory
1083454vjudge1Exhibition (JOI19_ho_t2)C++17
100 / 100
43 ms3436 KiB
#include <bits/stdc++.h> //#ifndef ONLINE_JUDGE //#include <debugging.h> //#endif #define ff first #define ss second #define pp push_back #define all(x) (x).begin(),(x).end() #define dbg(v) cout << "Line(" << __LINE__ << ") -> " << #v << " = " << (v) << endl; using namespace std; using ll = long long; using ld = long double; using pii = pair <int,int>; using pll = pair <ll,ll>; using pld = pair <ld,ld>; const char el ='\n'; const char sp = ' '; const int maxn = 2e5+5, mod = 1e9+7, N = 10; const ll inf = 1e18L+3; int n,m,b[maxn],ans; pii a[maxn]; void input() { cin>>n>>m; for(int i=1;i<=n;++i) cin>>a[i].ss>>a[i].ff; for(int i=1;i<=m;++i) cin>>b[i]; sort(a+1,a+n+1); sort(b+1,b+m+1); } void solve() { for(int i=m,j=n;i>0;--i) { if(j<1) break; while(j>0 && a[j].ss>b[i]) --j; if(j>0) { ++ans; --j; } } cout<<ans; } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int test = 1; // cin>>test; while(test-->0) { input(); solve(); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...