# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
712543 |
2023-03-19T06:46:17 Z |
gnhmhp |
Nizin (COCI16_nizin) |
C++17 |
|
67 ms |
10164 KB |
#define fastio ios_base::sync_with_stdio(false); cin.tie(nullptr)
#include <bits/stdc++.h>
using namespace std;
const int maxn=1e6+5;
long long a[maxn];
int main()
{
fastio;
int n; cin >> n;
for (int i=1; i<=n; ++i)
cin >> a[i];
int i, j, ans=0;
for (i=1, j=n; i<j; )
{
++ans;
if (a[i]<a[j])
{
a[i+1]+=a[i];
++i;
}
else if (a[i]>a[j])
{
a[j-1]+=a[j];
--j;
}
else
++i, --j, --ans;
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
324 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
320 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
324 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
976 KB |
Output is correct |
2 |
Correct |
7 ms |
1236 KB |
Output is correct |
3 |
Correct |
6 ms |
1232 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
20 ms |
3656 KB |
Output is correct |
2 |
Correct |
27 ms |
4508 KB |
Output is correct |
3 |
Correct |
30 ms |
5200 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
7756 KB |
Output is correct |
2 |
Correct |
67 ms |
8140 KB |
Output is correct |
3 |
Correct |
52 ms |
9068 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
9908 KB |
Output is correct |
2 |
Correct |
57 ms |
10164 KB |
Output is correct |
3 |
Correct |
59 ms |
10084 KB |
Output is correct |