57922023-10-01 13:44:29xxxÉrdekes túra (70 pont)cpp14Runtime error 23/706ms4816 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 = 1;
	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
base23/70
1Accepted0/03ms1788 KiB
2Runtime error0/04ms2048 KiB
3Wrong answer0/33ms2160 KiB
4Partially correct1/32ms2372 KiB
5Accepted3/32ms2696 KiB
6Accepted3/32ms2908 KiB
7Accepted3/33ms3124 KiB
8Accepted3/32ms3080 KiB
9Partially correct2/33ms3332 KiB
10Partially correct2/33ms3288 KiB
11Partially correct2/33ms3548 KiB
12Partially correct2/33ms3628 KiB
13Partially correct2/44ms3704 KiB
14Runtime error0/46ms3936 KiB
15Runtime error0/46ms4148 KiB
16Runtime error0/44ms4268 KiB
17Runtime error0/44ms4376 KiB
18Runtime error0/44ms4524 KiB
19Runtime error0/44ms4556 KiB
20Runtime error0/46ms4816 KiB
21Runtime error0/46ms4800 KiB
22Runtime error0/44ms4804 KiB