# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
170317 |
2019-12-24T19:55:27 Z |
ngmh |
Nizin (COCI16_nizin) |
C++11 |
|
272 ms |
10272 KB |
#include <bits/stdc++.h>
using namespace std;
long long n, a[1000000], s, e, o;
int main(){
cin >> n;
for(int i = 0; i < n; i++) cin >> a[i];
e = n-1;
while(s != e && s < e){
if(a[s] == a[e]){
s++;
e--;
} else if(a[s] < a[e]){
a[s+1] += a[s];
s++;
o++;
} else {
a[e-1] += a[e];
e--;
o++;
}
}
cout << o;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
504 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 |
376 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 |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
252 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
2 ms |
380 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
23 ms |
1144 KB |
Output is correct |
2 |
Correct |
28 ms |
1272 KB |
Output is correct |
3 |
Correct |
29 ms |
1332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
100 ms |
3676 KB |
Output is correct |
2 |
Correct |
115 ms |
4548 KB |
Output is correct |
3 |
Correct |
138 ms |
5324 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
201 ms |
7892 KB |
Output is correct |
2 |
Correct |
212 ms |
8312 KB |
Output is correct |
3 |
Correct |
237 ms |
9208 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
264 ms |
9976 KB |
Output is correct |
2 |
Correct |
272 ms |
10232 KB |
Output is correct |
3 |
Correct |
264 ms |
10272 KB |
Output is correct |