Submission #1159741

#TimeUsernameProblemLanguageResultExecution timeMemory
1159741weakweakweakExhibition (JOI19_ho_t2)C++20
0 / 100
0 ms328 KiB
// g++ -Wall -Wextra -std=c++17 -o B B.cpp #include <bits/stdc++.h> using namespace std; using ll = long long ; using pii = pair<int,int>; using pll = pair<ll, ll>; #define fs first #define sc second #define MP make_pair int n, m, b[101000]; pii a[101000]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n >> m; for (int i = 1; i <= n; i++) cin >> a[i].sc >> a[i].fs; for (int i = 1; i <= m; i++) cin >> b[i]; sort(b+1, b+1+m); reverse(b+1, b+1+m); sort(a+1, a+1+n); reverse(a+1, a+1+n); int ans = 0, j = 1; for (int i = 1; i <= m; i++) { while (j <= n) { if (a[i].sc <= b[j]) { j++; ans++; break; } j++; } } cout << ans << '\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...