Submission #938052

#TimeUsernameProblemLanguageResultExecution timeMemory
938052AndreyExhibition (JOI19_ho_t2)C++14
100 / 100
38 ms4700 KiB
#include<bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int n,m,a,b,ans = 0; cin >> n >> m; vector<pair<int,int>> haha(n); vector<int> bruh(m); for(int i = 0; i < n; i++) { cin >> a >> b; haha[i] = {b,a}; } for(int i = 0; i < m; i++) { cin >> bruh[i]; } sort(haha.begin(),haha.end()); sort(bruh.begin(),bruh.end()); int y = m-1; for(int i = n-1; i >= 0; i--) { if(y >= 0 && bruh[y] >= haha[i].second) { y--; } } cout << m-1-y; return 0; }

Compilation message (stderr)

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:9:17: warning: unused variable 'ans' [-Wunused-variable]
    9 |     int n,m,a,b,ans = 0;
      |                 ^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...