# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
108739 | 2019-05-01T08:04:24 Z | tictaccat | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++14 | 3 ms | 1536 KB |
#include <bits/stdc++.h> using namespace std; const int MAX = 1e5 + 10; int N,M; vector<pair<int,int>> pics(MAX); vector<int> C(MAX); bool check(int k) { int j = 0; for (int i = 0; i < k; i++) { while (j < N && pics[j].first > C[M-k+i]) j++; if (j == N) return false; j++; } return true; } int main() { cin >> N >> M; for (int i = 0; i < N; i++) cin >> pics[i].first >> pics[i].second; for (int i = 0; i < M; i++) cin >> C[i]; sort(pics.begin(),pics.begin()+N,[](pair<int,int> p1, pair<int,int> p2) {return p1.second < p1.second;}); sort(C.begin(),C.begin()+M); int k = 0; int high = N+1; for (int b = high/2; b > 0; b /= 2) { while (k + b < high && check(k+b)) k += b; } cout << k << "\n"; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1536 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1536 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1536 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1536 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |