# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
242334 | 2020-06-27T08:57:21 Z | SomeoneUnknown | Triple Jump (JOI19_jumps) | C++14 | 4000 ms | 13208 KB |
#include <bits/stdc++.h> using namespace std; int main(){ int n; scanf("%d", &n); int firm[n]; for(int i = 0; i < n; ++i){ scanf("%d", &firm[i]); } int best[n][n]; for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ best[i][j] = 0; if(j <= i+1){ continue; } int base = firm[i]+firm[j]; for(int k = i+1; k <= (i+j)/2; k++){ best[i][j] = max(best[i][j], base + firm[k]); } } } int q; scanf("%d", &q); for(int i = 0; i < q; i++){ int a, c; scanf("%d %d", &a, &c); int cbest = 0; for(int j = a; j < c; j++){ for(int k = j+2; k <= c; k++){ cbest = max(cbest, best[j-1][k-1]); } } printf("%d\n", cbest); } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 5 ms | 384 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 5 ms | 384 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Execution timed out | 4059 ms | 13208 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 38 ms | 2040 KB | Execution killed with signal 11 (could be triggered by violating memory limits) |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 256 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 5 ms | 384 KB | Output is correct |
4 | Correct | 5 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Correct | 5 ms | 384 KB | Output is correct |
9 | Correct | 5 ms | 384 KB | Output is correct |
10 | Correct | 5 ms | 384 KB | Output is correct |
11 | Execution timed out | 4059 ms | 13208 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |