Submission #83595

# Submission time Handle Problem Language Result Execution time Memory
83595 2018-11-09T12:51:03 Z luciocf Nizin (COCI16_nizin) C++14
0 / 100
202 ms 4388 KB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int maxn = 1e6+10;

int num[maxn];

int main(void)
{
	int n;
	cin >> n;

	for (int i = 1; i <= n; i++)
		cin >> num[i];

	int l = 1, r = n, ans = 0;
	ll somal = num[1], somar = num[n];

	while (true)
	{
		if (l > r) break;

		if (somal < somar) somal += (ll)num[++l], ans++;
		else if (somar < somal) somar += (ll)num[--r], ans++;
		else somal = num[++l], somar = num[--r];
	}

	cout << ans << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 508 KB Output is correct
3 Incorrect 1 ms 548 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 18 ms 764 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 67 ms 1788 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 152 ms 3400 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 202 ms 4388 KB Output isn't correct
2 Halted 0 ms 0 KB -