239542026-02-02 14:41:37PKAÉrdekes túra (70 pont)cpp17Partially correct 60/7029ms1268 KiB
#include <iostream>
#include<vector>
using namespace std;

int main()
{
    long long current = 1;
    long long turakszama = 0;
    long long leghosszab =  0;
    long long N;
    cin >> N;
    vector<long long>szamok(N);
    for(long long i = 0; i < N; i++){
        cin >> szamok[i];
    }
    current++;
    for(long long i = 1; i< N; i++){
        if(szamok[i]!= szamok[i-1]){
            current++;
        }else{
            if(current >= 2){
                turakszama++;
            }
            if(current > leghosszab && current != 1){
                leghosszab= current;
            }
            current = 1;
        }
    }
    if(current >= 2){
    turakszama++;
}
    if(current > leghosszab){
        leghosszab = current;
    }
    cout << turakszama<<endl;
    cout <<leghosszab;
}
SubtaskSumTestVerdictTimeMemory
base60/70
1Accepted0/01ms316 KiB
2Accepted0/026ms1076 KiB
3Partially correct1/31ms316 KiB
4Wrong answer0/31ms316 KiB
5Partially correct2/31ms316 KiB
6Partially correct2/31ms316 KiB
7Accepted3/31ms316 KiB
8Partially correct2/31ms500 KiB
9Accepted3/31ms316 KiB
10Accepted3/31ms316 KiB
11Accepted3/31ms316 KiB
12Partially correct1/32ms352 KiB
13Accepted4/42ms316 KiB
14Accepted4/414ms808 KiB
15Accepted4/418ms1016 KiB
16Accepted4/417ms952 KiB
17Accepted4/419ms820 KiB
18Accepted4/419ms1040 KiB
19Accepted4/427ms1268 KiB
20Accepted4/425ms1192 KiB
21Accepted4/429ms1196 KiB
22Accepted4/423ms1112 KiB