57962023-10-01 14:15:59xxxÉrdekes túra (70 pont)cpp14Runtime error 1/706ms4216 KiB
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<n;i++)

int main() {
	int n;
	cin >> n;
	int m[10002] = {0};
	rep(i, n) {
		cin >> m[i];
	}

	int ans = 0, ans2 = 1;
	int vanecnt = 1;
	for(int i = 1; i < n; i++) {
		if (m[i-1] != m[i]) {
			vanecnt = 1;
		} else {
			if (vanecnt == 1) {
				ans++;
			}
			vanecnt++;
			ans2 = max(ans2, vanecnt);
		}
	}

	cout << ans << "\n" << (ans == 0 ? -1 : ans2) << "\n";

	return 0;
}

SubtaskSumTestVerdictTimeMemory
base1/70
1Accepted0/03ms1908 KiB
2Runtime error0/04ms2220 KiB
3Wrong answer0/33ms2460 KiB
4Wrong answer0/33ms2712 KiB
5Wrong answer0/32ms2688 KiB
6Wrong answer0/32ms2728 KiB
7Partially correct1/33ms2856 KiB
8Wrong answer0/32ms2864 KiB
9Wrong answer0/33ms3076 KiB
10Wrong answer0/33ms3220 KiB
11Wrong answer0/33ms3268 KiB
12Wrong answer0/33ms3264 KiB
13Wrong answer0/43ms3524 KiB
14Runtime error0/46ms3576 KiB
15Runtime error0/46ms3520 KiB
16Runtime error0/44ms3760 KiB
17Runtime error0/46ms3728 KiB
18Runtime error0/44ms3848 KiB
19Runtime error0/46ms3976 KiB
20Runtime error0/44ms4060 KiB
21Runtime error0/46ms4168 KiB
22Runtime error0/44ms4216 KiB