제출 #1126473

#제출 시각아이디문제언어결과실행 시간메모리
1126473ALTAKEXEExhibition (JOI19_ho_t2)C++20
0 / 100
1 ms328 KiB
#include <bits/stdc++.h> #define ll long long #define ff first #define ss second #define inf INT_MAX #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FAR(i, a, b) for (int i = (a); i >= (b); i--) #define all(x) (x.begin(), x.end()) const int MOD = 1e9 + 7; using namespace std; int main() { int n, m, ans = 0; cin >> n >> m; pair<int, int> v[n]; int c[m]; for (int i = 0; i < n; i++) cin >> v[i].ss >> v[i].ff; for (int i = 0; i < m; i++) cin >> c[i]; sort(v, v + n); sort(c, c + m); for (int i = n - 1, j = m - 1; i >= 0 && j >= 0;) { if (v[i].ss <= c[j]) { i--; j--; ans++; } else j--; } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...