Submission #661103

# Submission time Handle Problem Language Result Execution time Memory
661103 2022-11-24T12:12:12 Z Trisanu_Das Nizin (COCI16_nizin) C++17
0 / 100
142 ms 6036 KB
#include <bits/stdc++.h>
using namespace std;

int main(){
  int n; cin >> n;
  int a[n]; for(int i = 0; i < n; i++) cin >> a[i];
  int l = 1, r = n, ans = 0;
  while(l <= r){
    if(a[l] == a[r])l++,r--;
    else if(a[l] > a[r]){a[r - 1] += r; r--; ans++;}
    else {a[l + 1] += a[l]; l++; ans++;}
  }
  cout << ans << '\n';
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 296 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 296 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 10 ms 756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 2336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 113 ms 4764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 142 ms 6036 KB Output isn't correct
2 Halted 0 ms 0 KB -