# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
113280 | 2019-05-24T16:16:54 Z | CaQtiml | Nizin (COCI16_nizin) | C++14 | 171 ms | 6308 KB |
#include "bits/stdc++.h" using namespace std; int arr[(int)1e6+10]; int solve(int i , int j) { if(i>=j) return 0; if(arr[i]==arr[j]) return solve(i+1,j-1); else if(arr[i]<arr[j]) { arr[i+1]+=arr[i]; return 1+solve(i+1,j); } else if(arr[i]>arr[j]) { arr[j-1]+=arr[j]; return 1+solve(i,j-1); } } int main() { int n; cin >> n; for(int i=1;i<=n;i++) cin >> arr[i]; cout << solve(1,n); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 512 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 3 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 364 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 14 ms | 768 KB | Output is correct |
2 | Correct | 19 ms | 896 KB | Output is correct |
3 | Correct | 19 ms | 896 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 55 ms | 2424 KB | Output is correct |
2 | Correct | 66 ms | 2808 KB | Output is correct |
3 | Correct | 79 ms | 3484 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 116 ms | 4828 KB | Output is correct |
2 | Correct | 124 ms | 5240 KB | Output is correct |
3 | Correct | 146 ms | 5776 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 171 ms | 6260 KB | Output is correct |
2 | Correct | 167 ms | 6304 KB | Output is correct |
3 | Correct | 155 ms | 6308 KB | Output is correct |