Submission #164838

#TimeUsernameProblemLanguageResultExecution timeMemory
164838cbertramExhibition (JOI19_ho_t2)C++14
100 / 100
430 ms4572 KiB
#include <bits/stdc++.h> using namespace std; typedef long long int ll; typedef pair<int,int> pii; typedef pair<ll,ll> pll; typedef vector<bool> vb; typedef vector<int> vi; typedef vector<ll> vll; typedef vector<pii> vpii; typedef vector<pll> vpll; typedef vector<string> vs; typedef vector<vb> vvb; typedef vector<vi> vvi; typedef vector<vll> vvll; #define all(x) x.begin(), x.end() #define rep(i,a,b) for(int i = a; i < b; i++) int main() { int N, M; cin >> N; cin >> M; vpii P(N); rep(n,0,N) { int s, v; cin >> s; cin >> v; P[n] = make_pair(v, s); } sort(all(P), greater<>()); vi F(M); rep(m,0,M) cin >> F[m]; sort(all(F), greater<>()); int num = 0; int m = 0; for(int n = 0; n < N && m < M; n++) { if(P[n].second <= F[m]) { num++; m++; } } cout << m << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...