57912023-10-01 13:41:58xxxÉrdekes túra (70 pont)cpp14Runtime error 17/706ms4528 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 = 0;
	bool vane = false;
	int vanecnt = 0;
	for(int i = 1; i < n; i++) {
		if (m[i-1] != m[i]) {
			vane = true;
			vanecnt++;
		} else if (vane) {
			vane = false;
			ans2 = max(ans2, vanecnt);
			ans++;
			vanecnt = 1;
		}
	}
	cout << ans << "\n" << ans2 << "\n";

	return 0;
}
SubtaskSumTestVerdictTimeMemory
base17/70
1Accepted0/03ms1784 KiB
2Runtime error0/04ms2048 KiB
3Wrong answer0/33ms2316 KiB
4Partially correct1/32ms2244 KiB
5Partially correct1/33ms2652 KiB
6Partially correct1/32ms2720 KiB
7Accepted3/33ms2796 KiB
8Accepted3/33ms3008 KiB
9Partially correct2/33ms3352 KiB
10Partially correct2/33ms3308 KiB
11Partially correct2/33ms3304 KiB
12Wrong answer0/33ms3516 KiB
13Partially correct2/43ms3732 KiB
14Runtime error0/44ms3816 KiB
15Runtime error0/46ms4060 KiB
16Runtime error0/46ms4308 KiB
17Runtime error0/44ms4384 KiB
18Runtime error0/44ms4388 KiB
19Runtime error0/44ms4384 KiB
20Runtime error0/44ms4512 KiB
21Runtime error0/46ms4528 KiB
22Runtime error0/44ms4524 KiB