# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
23062 | 2017-05-02T14:41:50 Z | model_code | Nizin (COCI16_nizin) | C++11 | 103 ms | 8928 KB |
#include <cstdio> using namespace std; typedef long long llint; const int MAXN = 1e6 + 10; int n; llint a[MAXN]; int main(void) { scanf("%d", &n); for (int i = 0; i < n; ++i) scanf("%lld", &a[i]); int sol = 0, lo = 0, hi = n - 1; while (lo < hi) { if (a[lo] == a[hi]) { ++lo; --hi; continue; } if (a[lo] < a[hi]) { a[lo + 1] += a[lo]; ++lo; } else { a[hi - 1] += a[hi]; --hi; } ++sol; } printf("%d\n", sol); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8928 KB | Output is correct |
2 | Correct | 0 ms | 8928 KB | Output is correct |
3 | Correct | 0 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8928 KB | Output is correct |
2 | Correct | 0 ms | 8928 KB | Output is correct |
3 | Correct | 0 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8928 KB | Output is correct |
2 | Correct | 0 ms | 8928 KB | Output is correct |
3 | Correct | 0 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8928 KB | Output is correct |
2 | Correct | 0 ms | 8928 KB | Output is correct |
3 | Correct | 0 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8928 KB | Output is correct |
2 | Correct | 0 ms | 8928 KB | Output is correct |
3 | Correct | 0 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 8928 KB | Output is correct |
2 | Correct | 0 ms | 8928 KB | Output is correct |
3 | Correct | 0 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 6 ms | 8928 KB | Output is correct |
2 | Correct | 9 ms | 8928 KB | Output is correct |
3 | Correct | 9 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 36 ms | 8928 KB | Output is correct |
2 | Correct | 43 ms | 8928 KB | Output is correct |
3 | Correct | 56 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 69 ms | 8928 KB | Output is correct |
2 | Correct | 69 ms | 8928 KB | Output is correct |
3 | Correct | 96 ms | 8928 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 96 ms | 8928 KB | Output is correct |
2 | Correct | 103 ms | 8928 KB | Output is correct |
3 | Correct | 93 ms | 8928 KB | Output is correct |