제출 #370564

#제출 시각아이디문제언어결과실행 시간메모리
370564vot808Exhibition (JOI19_ho_t2)C++17
100 / 100
34 ms1644 KiB
#include "bits/stdc++.h" using namespace std; #define for_(i, s, e) for (int i = s; i < (int) e; i++) #define for__(i, s, e) for (ll i = s; i < e; i++) typedef long long ll; typedef vector<int> vi; typedef array<int, 2> ii; #define endl '\n' namespace speedy_io { int read_nonneg() { int c; while ((c = getchar_unlocked()) < '0' || c > '9'); int v = c - '0'; while ((c = getchar_unlocked()) >= '0' && c <= '9') { v = (v << 3) + (v << 1) + (c - '0'); } return v; } const int max_ll_size = 20; void put_nonneg(ll n) { int i = max_ll_size; char output_buffer[max_ll_size]; do { output_buffer[--i] = (n % 10) + '0'; n /= 10; } while (n); do { putchar_unlocked(output_buffer[i]); } while (++i < max_ll_size); } } using namespace speedy_io; int main() { #ifdef mlocal freopen("test.in", "r", stdin); #endif // ios_base::sync_with_stdio(false); cin.tie(0); int n, m; cin >> n >> m; ii pic[n]; int sz[m]; for_(i, 0, n) pic[i][1] = read_nonneg(), pic[i][0] = read_nonneg(); sort(pic, pic+n, greater<>()); for_(i, 0, m) sz[i] = read_nonneg(); sort(sz, sz+m, greater<>()); int ans = 0, pt = 0; for_(i, 0, m) { while (pt < n and sz[i] < pic[pt][1]) pt++; if (pt < n) { pt++; ans++; } else break; } cout << ans << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...