# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
300522 | 2020-09-17T08:40:03 Z | Pro100Yan | Comparing Plants (IOI20_plants) | C++14 | 65 ms | 5628 KB |
#include "plants.h" #include <bits/stdc++.h> #define ll long long using namespace std; const int N = 2005; ll pref[2 * N], n; void init(int k, std::vector<int> r) { int l = n = r.size(); for(int i = 0; i < n; i++) pref[i + 1] = pref[i] + r[i]; for(int i = n; i < 2 * n; i++) pref[i + 1] = pref[i] + r[i - n]; return; } int compare_plants(int x, int y) { if(pref[y] - pref[x] == y - x) return -1; else if(pref[x + n] - pref[y] == n + x - y) return 1; else if(pref[y] - pref[x] == 0) return 1; else if(pref[x + n] - pref[y] == 0) return -1; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 1 ms | 416 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 360 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 65 ms | 3192 KB | Output is correct |
7 | Runtime error | 63 ms | 5628 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Incorrect | 1 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Incorrect | 1 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Incorrect | 1 ms | 256 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Incorrect | 1 ms | 256 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 1 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Incorrect | 1 ms | 256 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | Output is correct |
2 | Correct | 1 ms | 416 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 360 KB | Output is correct |
5 | Correct | 1 ms | 256 KB | Output is correct |
6 | Correct | 65 ms | 3192 KB | Output is correct |
7 | Runtime error | 63 ms | 5628 KB | Execution killed with signal 11 |
8 | Halted | 0 ms | 0 KB | - |