Submission #661104

# Submission time Handle Problem Language Result Execution time Memory
661104 2022-11-24T12:13:17 Z Trisanu_Das Nizin (COCI16_nizin) C++17
0 / 100
135 ms 4112 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 0 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 212 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 0 ms 212 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 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 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 12 ms 596 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 53 ms 1624 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 130 ms 3236 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 135 ms 4112 KB Output isn't correct
2 Halted 0 ms 0 KB -