56192023-08-09 21:57:29999Érdekes túra (70 pont)cpp17Wrong answer 62/7029ms8096 KiB
// Source: https://usaco.guide/general/io

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

signed main() {
	int n;cin>>n;int a=0,b=0,currl=0,maxl=0,db=0;
	for(int i=0;i<n;i++){
		cin>>a;
		if(a==b){
			maxl=max(maxl,currl+1);
			if(currl>0){
				db++;
			}
			currl=0;
		}
		else if(i==n-1){
			maxl=max(maxl,currl+1);
			db++;
		}
		else{
			currl++;
		}
		b=a;
	}
	cout<<db<<endl<<maxl<<endl;
	/*
	int n,x;cin>>n>>x;
	int s3=0,sk=0;
	while(n--){
		int a;cin>>a;
		sk+=a%x;
		a-=a%x;
		s3+=a/x;
	}
	if(s3>=sk){
		int y=sk;
		s3-=sk;
		y+=s3/(x+1);
		cout<<y<<endl;
	}
	else if(s3<sk){
		cout<<s3<<endl;
	}*/
}
SubtaskSumTestVerdictTimeMemory
base62/70
1Accepted0/03ms2020 KiB
2Accepted0/025ms2652 KiB
3Accepted3/33ms2716 KiB
4Wrong answer0/33ms2888 KiB
5Partially correct2/33ms3100 KiB
6Partially correct2/33ms3348 KiB
7Accepted3/32ms3432 KiB
8Partially correct2/33ms3568 KiB
9Accepted3/33ms3932 KiB
10Accepted3/33ms3972 KiB
11Accepted3/33ms4212 KiB
12Partially correct1/33ms4492 KiB
13Accepted4/43ms4648 KiB
14Accepted4/416ms4792 KiB
15Accepted4/418ms5104 KiB
16Accepted4/417ms5544 KiB
17Accepted4/419ms5628 KiB
18Accepted4/420ms5932 KiB
19Accepted4/427ms6692 KiB
20Accepted4/425ms7224 KiB
21Accepted4/429ms7732 KiB
22Accepted4/423ms8096 KiB