# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
493899 |
2021-12-13T10:31:23 Z |
Karabasan |
Nizin (COCI16_nizin) |
C++17 |
|
50 ms |
7932 KB |
#include <bits/stdc++.h>
#define ll long long
#define fast1 ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define int long long
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("fma,sse,sse2,sse3,avx")
#pragma GCC optimize("unroll-loops")
int n;
int dizi[1000005];
void solve()
{
cin>>n;
for(int i=1;i<=n;i++)
cin>>dizi[i];
int i=1;
int j=n;
int cevap=0;
while(i<j)
{
if(dizi[i]!=dizi[j])
{
if(dizi[i]+dizi[i+1]==dizi[j])
{
cevap++;
i+=2;
j--;
}
else if(dizi[j]+dizi[j-1]==dizi[i])
{
cevap++;
i++;
j-=2;
}
else
{
cevap+=2;
dizi[i+1]=dizi[i]+dizi[i+1];
dizi[j-1]=dizi[j]+dizi[j-1];
i++;
j--;
}
}
else
{
i++;
j--;
}
}
cout<<cevap;
}
signed main()
{
fast1
int t=1;
//cin>>t;
while(t--)
{
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
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 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
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 |
Incorrect |
0 ms |
204 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
844 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
2916 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
40 ms |
6140 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
50 ms |
7932 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |