# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
493904 |
2021-12-13T10:40:03 Z |
Karabasan |
Nizin (COCI16_nizin) |
C++17 |
|
72 ms |
10264 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[j])
{
dizi[i+1]=dizi[i]+dizi[i+1];
i++;
cevap++;
}
else
{
dizi[j-1]=dizi[j]+dizi[j-1];
j--;
cevap++;
}
}
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 |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
0 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
0 ms |
316 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
320 KB |
Output is correct |
2 |
Correct |
1 ms |
324 KB |
Output is correct |
3 |
Correct |
1 ms |
460 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Correct |
1 ms |
332 KB |
Output is correct |
3 |
Correct |
1 ms |
332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
972 KB |
Output is correct |
2 |
Correct |
6 ms |
1228 KB |
Output is correct |
3 |
Correct |
5 ms |
1224 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
28 ms |
3120 KB |
Output is correct |
2 |
Correct |
25 ms |
4420 KB |
Output is correct |
3 |
Correct |
35 ms |
5236 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
43 ms |
6332 KB |
Output is correct |
2 |
Correct |
46 ms |
8368 KB |
Output is correct |
3 |
Correct |
57 ms |
9168 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
55 ms |
8080 KB |
Output is correct |
2 |
Correct |
72 ms |
10092 KB |
Output is correct |
3 |
Correct |
57 ms |
10264 KB |
Output is correct |