Submission #164622

# Submission time Handle Problem Language Result Execution time Memory
164622 2019-11-22T09:05:40 Z _qVp_ Nizin (COCI16_nizin) C++14
0 / 100
83 ms 6392 KB
#include <bits/stdc++.h>

using namespace std;

const int md = 1e6 + 10;

int a[md];
int n;

int main() {
    //freopen("test.in", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin >> n;
    for(int i = 1; i <= n; i++)
        cin >> a[i];
    int l = 1, r = n, vL = a[1], vR = a[n], cnt = 0;
    while (l <= r) {
        if (vL == vR) {
            vL = a[++l];
            vR = a[--r];
        } else if (vL < vR) {
            cnt++;
            vL += a[++l];
        } else {
            cnt++;
            vR += a[--r];
        }
    }
    cout << cnt;
    return 0;   
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Incorrect 2 ms 376 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 504 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 420 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 760 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 2484 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 4992 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 6392 KB Output isn't correct
2 Halted 0 ms 0 KB -