# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
510071 |
2022-01-14T16:17:58 Z |
Jean7 |
Nizin (COCI16_nizin) |
C++14 |
|
62 ms |
17236 KB |
#include <bits/stdc++.h>
#define fastio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
using namespace std ;
deque <int> d ;
int32_t main ()
{
fastio
int n , x , ans = 0 ;
cin >> n ;
for ( int i = 0 ; i < n; i++ )
{
cin >> x ;
d.push_back(x) ;
}
int j ;
while ( !d.empty() )
{
if ( d.front() < d.back() )
{
j = d.front() ;
d.pop_front() ;
d.front() += j ;
ans++ ;
}
else if ( d.front() > d.back() )
{
j = d.back() ;
d.pop_back() ;
d.back() += j ;
ans++ ;
}
else if ( d.front() == d.back() )
{
d.pop_back() ;
d.pop_front() ;
}
}
cout << ans ;
return 0 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
332 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
440 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
460 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
1864 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
23 ms |
6452 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
50 ms |
13508 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
62 ms |
17236 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |