# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
570354 | 2022-05-29T09:56:38 Z | urd05 | Triple Jump (JOI19_jumps) | C++17 | 4 ms | 444 KB |
#include <bits/stdc++.h> using namespace std; int arr[101]; int main() { int n,q; scanf("%d",&n); for(int i=1;i<=n;i++) { scanf("%d",&arr[i]); } scanf("%d",&q); for(int i=0;i<q;i++) { int l,r; scanf("%d %d",&l,&r); int ret=0; for(int i=l;i<=r;i++) { for(int j=i+1;j<=r;j++) { for(int k=j+1;k<=r;k++) { if (j-i<=k-j) { ret=max(ret,arr[i]+arr[j]+arr[k]); } } } } printf("%d\n",ret); } return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 3 ms | 212 KB | Output is correct |
3 | Correct | 3 ms | 300 KB | Output is correct |
4 | Correct | 3 ms | 212 KB | Output is correct |
5 | Correct | 3 ms | 212 KB | Output is correct |
6 | Correct | 3 ms | 212 KB | Output is correct |
7 | Correct | 3 ms | 212 KB | Output is correct |
8 | Correct | 3 ms | 212 KB | Output is correct |
9 | Correct | 4 ms | 212 KB | Output is correct |
10 | Correct | 2 ms | 212 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 3 ms | 212 KB | Output is correct |
3 | Correct | 3 ms | 300 KB | Output is correct |
4 | Correct | 3 ms | 212 KB | Output is correct |
5 | Correct | 3 ms | 212 KB | Output is correct |
6 | Correct | 3 ms | 212 KB | Output is correct |
7 | Correct | 3 ms | 212 KB | Output is correct |
8 | Correct | 3 ms | 212 KB | Output is correct |
9 | Correct | 4 ms | 212 KB | Output is correct |
10 | Correct | 2 ms | 212 KB | Output is correct |
11 | Runtime error | 2 ms | 412 KB | Execution killed with signal 11 |
12 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 1 ms | 444 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Correct | 3 ms | 212 KB | Output is correct |
3 | Correct | 3 ms | 300 KB | Output is correct |
4 | Correct | 3 ms | 212 KB | Output is correct |
5 | Correct | 3 ms | 212 KB | Output is correct |
6 | Correct | 3 ms | 212 KB | Output is correct |
7 | Correct | 3 ms | 212 KB | Output is correct |
8 | Correct | 3 ms | 212 KB | Output is correct |
9 | Correct | 4 ms | 212 KB | Output is correct |
10 | Correct | 2 ms | 212 KB | Output is correct |
11 | Runtime error | 2 ms | 412 KB | Execution killed with signal 11 |
12 | Halted | 0 ms | 0 KB | - |