239502026-02-02 14:31:34PKAÉrdekes túra (70 pont)cpp17Hibás válasz 41/7029ms1276 KiB
#include <iostream>
#include<vector>
using namespace std;

int main()
{
    int current = 1;
    int turakszama = 0;
    int leghosszab =  0;
    int N;
    cin >> N;
    vector<int>szamok(N);
    for(int i = 0; i < N; i++){
        cin >> szamok[i];
    }
    for(int i = 1   ; i< N; i++){
        if(szamok[i]!= szamok[i-1]){
            current++;
        }else{
            if(current >= 2){
                turakszama++;
            }
            if(current > leghosszab){
                leghosszab= current;
            }
            current = 1;
        }
    }
    cout << turakszama<<endl;
    cout <<leghosszab;
}
RészfeladatÖsszpontTesztVerdiktIdőMemória
base41/70
1Elfogadva0/01ms316 KiB
2Hibás válasz0/025ms564 KiB
3Hibás válasz0/31ms500 KiB
4Részben helyes1/31ms508 KiB
5Elfogadva3/31ms316 KiB
6Elfogadva3/31ms316 KiB
7Elfogadva3/31ms316 KiB
8Elfogadva3/31ms380 KiB
9Részben helyes2/31ms500 KiB
10Részben helyes2/31ms316 KiB
11Részben helyes2/32ms316 KiB
12Részben helyes2/32ms316 KiB
13Részben helyes2/42ms428 KiB
14Részben helyes2/414ms844 KiB
15Részben helyes2/417ms884 KiB
16Részben helyes2/417ms820 KiB
17Részben helyes2/419ms976 KiB
18Részben helyes2/419ms820 KiB
19Részben helyes2/427ms1124 KiB
20Részben helyes2/425ms1168 KiB
21Részben helyes2/429ms1276 KiB
22Részben helyes2/421ms1076 KiB