Submission #786143

#TimeUsernameProblemLanguageResultExecution timeMemory
786143makanhuliaExhibition (JOI19_ho_t2)C++17
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> #define int long long #define fi first #define se second #define keish ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) using namespace std; int n, m; signed main(){ keish; cin >> n >> m; vector<pair<int ,int>> a(n); for(int i = 0; i < n; i++) cin >> a[i].se >> a[i].fi; vector<int> c(m); for(int i = 0; i < n; i++) cin >> c[i]; sort(a.begin(), a.end()); sort(c.begin(), c.end()); int prv = 0, ans = 0; for(int i = 0; i < n; i++){ if(prv < a[i].se){ prv = a[i].se; ans++; } } cout << ans << '\n'; } // 1 5 // 5 3 // 20 10
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...