Submission #586975

#TimeUsernameProblemLanguageResultExecution timeMemory
586975Justin1Exhibition (JOI19_ho_t2)C++14
100 / 100
48 ms5628 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; struct pic{ ll s, v; bool operator < (const pic & x) const { if (v != x.v) return v < x.v; return s < x.s; } }; ll n,m,k,x,y,z; ll c[100005], done[100005]; pic p[100005]; int main() { cin.tie(0), cout.tie(0) -> sync_with_stdio(0); cin >> n >> m; for (int i = 1; i <= n; i++) cin >> p[i].s >> p[i].v; for (int i = 1; i <= m; i++) cin >> c[i]; sort(c+1,c+1+m); sort(p+1,p+1+n); ll ans = 0; for (int i = n; i >= 1; i--) { if (p[i].s <= c[m-ans]) ans++; } cout << ans << "\n"; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...