# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
119064 | 2019-06-20T08:54:37 Z | Bruteforceman | Cambridge (info1cup18_cambridge) | C++11 | 2000 ms | 4960 KB |
#include "bits/stdc++.h" using namespace std; typedef pair <int, int> pii; int t[100010], d[100010]; int query(int x, int y) { vector <pii> v; for(int i = x; i <= y; i++) { v.emplace_back(d[i], t[i]); } sort(v.begin(), v.end()); long long sum = 0; for(int i = 0; i < v.size(); i++) { sum += v[i].second; if(sum >= v[i].first) { return false; } } return true; } int main(int argc, char const *argv[]) { int n, m; scanf("%d %d", &n, &m); for(int i = 1; i <= n; i++) { scanf("%d %d", &t[i], &d[i]); } while(m--) { int p, q; scanf("%d %d", &p, &q); printf("%d\n", query(p, q)); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 640 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 640 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 29 ms | 3192 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 6 ms | 768 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 640 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 545 ms | 940 KB | Output is correct |
4 | Correct | 1113 ms | 1668 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 640 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 29 ms | 3192 KB | Output is correct |
4 | Correct | 3 ms | 384 KB | Output is correct |
5 | Correct | 6 ms | 768 KB | Output is correct |
6 | Correct | 545 ms | 940 KB | Output is correct |
7 | Correct | 1113 ms | 1668 KB | Output is correct |
8 | Execution timed out | 2045 ms | 4960 KB | Time limit exceeded |
9 | Halted | 0 ms | 0 KB | - |