Submission #799425

# Submission time Handle Problem Language Result Execution time Memory
799425 2023-07-31T14:09:49 Z tlnk07 Izbori (COCI22_izbori) C++17
0 / 110
3000 ms 1620 KB
#include<bits/stdc++.h>
using namespace std;

long long n, pre[200001], x, cnt = 0;

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);	cout.tie(NULL);
	cin >> n;
	pre[0] = 0;
	for(int i = 1; i <= n; ++i)
	{
		cin >> x;
		if(x == 1)	pre[i] = pre[i - 1] + 1;
		else	pre[i] = pre[i - 1];
	}
	for(int i = 1; i <= n; ++i)	for(int j = 1; j <= i; ++j)	if((pre[i] - pre[j - 1]) * 2 != i - j + 1) ++cnt;
	cout << cnt;
}
# 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 Execution timed out 3030 ms 1620 KB Time limit exceeded
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 -