제출 #824824

#제출 시각아이디문제언어결과실행 시간메모리
824824ElyesChaabouniExamination (JOI19_examination)C++14
0 / 100
29 ms3248 KiB
#include<bits/stdc++.h> #pragma GCC optimize("Ofast") //#pragma GCC target ("avx2") //#pragma GCC optimization ("O3") //#pragma GCC optimization ("unroll-loops") #define INV_2 499122177 #define INF 1000000000 #define PI 3.14159265358979323846 #define eps 1e-9 #define MOD1 998244353 #define MOD2 1000000007 using namespace std; int main() { ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n, m; cin >> n >> m; pair<int, int>a[n]; for(int i = 0; i < n; i++) cin >> a[i].second >> a[i].first; int b[m]; for(int i = 0; i < m; i++) cin >> b[i]; sort(a, a+n); sort(b, b+m); int idx=m-1; int ans=0; for(int i = n-1; i >= 0; i--) { if(idx >= 0 && a[i].second <= b[idx]) { idx--; ans++; } } cout << ans << '\n'; } //07-02-46
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...