제출 #531977

#제출 시각아이디문제언어결과실행 시간메모리
531977syl123456Exhibition (JOI19_ho_t2)C++17
100 / 100
66 ms4384 KiB
#include <bits/stdc++.h> #define all(i) (i).begin(), (i).end() using namespace std; template<typename T1, typename ...T2> void debug(bool _split, T1 i, T2 ...j) { if (_split) cerr << ", "; cerr << i; debug(true, j...); } #define debug(args...) cout << "Line" << __LINE__ << " : [" << #args << << "] is [" << debug(false, args) << "]" << endl; typedef pair<int, int> pi; typedef long long ll; const int inf = 0x3f3f3f3f, lg = 20; const ll mod = 1e9 + 7, INF = 0x3f3f3f3f; signed main() { ios::sync_with_stdio(0), cin.tie(0); int n, m; cin >> n >> m; pi a[n]; for (pi &i : a) cin >> i.first >> i.second; sort(a, a + n, [](pi i, pi j) { if (i.second != j.second) return i.second > j.second; return i.first > j.first; }); int b[m]; for (int &i : b) cin >> i; sort(b, b + m, [](int i, int j) {return i > j;}); int tmp = 0; for (auto [x, y] : a) { if (tmp < m && b[tmp] >= x) ++tmp; } cout << tmp; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...