# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
510288 |
2022-01-14T22:13:39 Z |
basheer |
Nizin (COCI16_nizin) |
C++17 |
|
1000 ms |
7884 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll x,y,n,sum1,sum2,ans;
int main()
{
cin>>n;
ll a[n];
for(ll i=0; i<n; i++)
cin>>a[i];
x=0;
y=n-1;
sum1=0;
sum2=0;
while(y>x)
{
if(a[y]==a[x])
{
y--;
x++;
sum1=0;
sum2=0;
continue;
}
if(a[y]>a[x])
{
sum1+=a[x];
x++;
sum2+=a[y];
y--;
}
while(sum1!=sum2)
{
if(sum2>sum1)
{
sum1+=a[x];
x++;
}
else
{
sum2+=a[y];
y--;
}
ans++;
}
}
cout<<ans;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
256 KB |
Output is correct |
3 |
Execution timed out |
1098 ms |
208 KB |
Time limit exceeded |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1081 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1080 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1094 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1086 ms |
204 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1090 ms |
844 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1083 ms |
2892 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1087 ms |
6092 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1084 ms |
7884 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |