56252023-08-09 23:50:49999Érdekes túra (70 pont)cpp17Wrong answer 62/7029ms4392 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+1>=2){
                db++;
            }
            currl=0;
        }
        else if(i==n-1){
            maxl=max(maxl,currl+1);
            db++;
        }
        else{
            currl++;
        }
        b=a;
    }
    cout<<db<<endl;
    cout<<maxl<<endl;
    return 0;
}
/*
#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
	/*int n,x;cin>>n>>x;
	int g=0;
	vector<int> v;
	while(n--){
		int a;cin>>a;
		v.push_back(a%(x+1));
		a-=a%(x+1);
		g+=a/(x+1);	
	}int y=0,z=0,sum=0;
	for(int i : v){
		if(i==x){
			y++;
		}
		else{
			sum+=i;
			z++;
		}
	}
	if(y<=sum){
		cout<<g+y<<endl;
	}
	else {
		while(y<=sum){
			y--;
			sum+=x;
		}
		cout<<g+y<<endl;
	}
	int n;cin>>n;
	mao<int,int> m;
	for(int i = 0;i<n;i++){
		int a;cin>>a;
		m[a]=i+1;
	}
	int moves=0;
	bool ps=false;
	while(true){
		if(ps){

		}
		else{
			for(auto i : m){
				if(i.first==n){
					cout<<moves<<endl;
					return 0;
				}
				else if(i.first!=i.second){
					m[i.first]=1;
					
				}
			}
		}
	}
}*/
SubtaskSumTestVerdictTimeMemory
base62/70
1Accepted0/03ms1748 KiB
2Accepted0/026ms1988 KiB
3Accepted3/33ms2156 KiB
4Wrong answer0/32ms2336 KiB
5Partially correct2/33ms2552 KiB
6Partially correct2/33ms2760 KiB
7Accepted3/32ms2968 KiB
8Partially correct2/33ms3184 KiB
9Accepted3/33ms3304 KiB
10Accepted3/33ms3428 KiB
11Accepted3/33ms3636 KiB
12Partially correct1/33ms3728 KiB
13Accepted4/43ms3832 KiB
14Accepted4/416ms3840 KiB
15Accepted4/418ms3692 KiB
16Accepted4/418ms3692 KiB
17Accepted4/419ms3696 KiB
18Accepted4/420ms3692 KiB
19Accepted4/428ms3804 KiB
20Accepted4/426ms3936 KiB
21Accepted4/429ms4180 KiB
22Accepted4/423ms4392 KiB