Submission #884732

#TimeUsernameProblemLanguageResultExecution timeMemory
884732DuongajaasExhibition (JOI19_ho_t2)C++14
0 / 100
1 ms1112 KiB
#include <bits/stdc++.h> using namespace std; const long Nmax = 1e5 + 5; long c[Nmax]; int n, m; struct mang { int first, second; }; bool cmp(mang x, mang y) { if (x.first == y.first) return x.second < y.second; else return x.first < y.first; } int main() { cin.tie(NULL) -> sync_with_stdio(false); cin >> n >> m; mang a[Nmax]; for (int i = 1; i <= n; ++i) cin >> a[i].first >> a[i].second; for (int j = 1; j <= m; ++j) cin >> c[j]; sort(a+1, a+n+1, cmp); sort(c+1, c+m+1); int ind = 1; int ans = 1; for (int i = 1; i <= m; ++i) { while (ind <= n && a[ind].first > c[i]) ind++; if (ind > n) break; cout << ind << endl; ans++; ind++; } cout << ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...