Submission #1034117

#TimeUsernameProblemLanguageResultExecution timeMemory
1034117vjudge1Exhibition (JOI19_ho_t2)C++17
100 / 100
99 ms4524 KiB
#include<bits/stdc++.h> using namespace std; const int N = 1e5; pair<int,int>p[N+5]; int c[N+5]; int main(){ int n,m; cin >> n >> m; for(int i = 0; i < n; i++)cin >> p[i].second >> p[i].first; sort(p,p+n); // for(int i = n-1; i >= 0; i--)cout << p[i].first << " " << p[i].second <<endl; for(int i = 0; i < m; i++)cin >> c[i]; sort(c,c+m); //for(int i = m-1; i >= 0; i--)cout << c[i] << endl; int j = n-1; int dem = 0; for(int i = m-1; i >= 0; i--){ while(j >= 0 && p[j].second > c[i]){ j--; // cout << p[i].second << " " << c[i]<<endl; } if(j == -1){ break; } else { dem++; j--; //cout << endl; } } cout << dem; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...