# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
265318 | 2020-08-14T15:35:41 Z | T0p_ | Lightning Rod (NOI18_lightningrod) | C++14 | 2000 ms | 61596 KB |
#include<bits/stdc++.h> using namespace std; pair<int, int> arr[10000005]; int main() { int n, now = 0; scanf(" %d",&n); while(n--) { int x, y; scanf(" %d %d",&x,&y); if(now == 0) arr[++now] = {x, y}; else { int h = arr[now].second - x + arr[now].first; if(h >= y) continue ; int l = 1, r = now; while(l != r) { int mid = (l+r+1)>>1; int h = y - x + arr[mid].first; if(h >= arr[mid].second) r = mid-1; else l = mid; } now = l; arr[++now] = {x, y}; } } printf("%d\n",now); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2049 ms | 61596 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 384 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2077 ms | 41556 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2049 ms | 61596 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |