50992023-04-16 22:15:11tomi7Érdekes túra (70 pont)cpp11Wrong answer 35/7029ms4656 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

long long lko(long long n, long long m){
	if(n%m==0 || m%n==0){
		return min(n, m);
	}
	if(n>m){
		return lko(n%m, m);
	}else{
		return lko(m%n, n);
	}
}

int main() {
	int n;
	cin>>n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int valasz=1;
	int vvalasz=0;
	int szamolo=0;
	for(int i=0;i<n;i++){
		if(a[i]!=a[i-1]){
			valasz++;
		}else{
			if(valasz>1){
				vvalasz=max(valasz, vvalasz);
				szamolo++;
				valasz=1;
			}
		}
	}
	cout<<szamolo<<'\n'<<vvalasz<<'\n';
}
SubtaskSumTestVerdictTimeMemory
base35/70
1Accepted0/03ms1816 KiB
2Wrong answer0/026ms2712 KiB
3Wrong answer0/33ms2216 KiB
4Wrong answer0/33ms2432 KiB
5Partially correct2/33ms2668 KiB
6Partially correct2/33ms2724 KiB
7Accepted3/33ms2968 KiB
8Partially correct2/33ms3176 KiB
9Partially correct2/33ms3416 KiB
10Partially correct2/33ms3296 KiB
11Partially correct2/33ms3440 KiB
12Wrong answer0/33ms3524 KiB
13Partially correct2/44ms3408 KiB
14Partially correct2/417ms3836 KiB
15Partially correct2/418ms4048 KiB
16Partially correct2/418ms4172 KiB
17Partially correct2/419ms4128 KiB
18Partially correct2/420ms4132 KiB
19Partially correct2/427ms4428 KiB
20Partially correct2/427ms4528 KiB
21Partially correct2/429ms4656 KiB
22Partially correct2/423ms4364 KiB