9216 2024. 02. 18 18:12:56 Kristóf Táblajáték 2 (70 pont) cpp14 Hibás válasz 23/70 3ms 4124 KiB
#include <iostream>

using namespace std;
struct poz{

int sor;
int hely;

}typedef poz;

int main()
{
    struct poz tabla;
    tabla.sor=0;
    tabla.hely=0;
    int n;
    int num;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>num;
        if(num==0){
            tabla.sor++;
            tabla.hely=tabla.hely*3;
        }
        else if(num==1){
            tabla.sor++;
            tabla.hely=tabla.hely*3+1;
        }
        else if(num==2){
            tabla.sor++;
            tabla.hely=tabla.hely*3+2;
        }
        else if(num==3){
            tabla.sor--;
            tabla.hely=tabla.hely/3;
        }
        else if(num==4){
            tabla.hely--;
        }
        else{
            tabla.hely++;
        }

    }
    cout<<tabla.sor<<endl;
    if(tabla.hely<3){
        cout<<tabla.hely;
        return 0;
    }
    else{
    int szamm=(tabla.hely/3*10)+tabla.hely%3;
    cout<<szamm;
    }
    return 0;
}
Részfeladat Összpont Teszt Verdikt Idő Memória
base 23/70
1 Elfogadva 0/0 3ms 1872 KiB
2 Hibás válasz 0/0 3ms 2120 KiB
3 Részben helyes 1/2 3ms 2296 KiB
4 Részben helyes 1/3 3ms 2544 KiB
5 Részben helyes 1/3 3ms 2652 KiB
6 Részben helyes 1/3 3ms 2860 KiB
7 Részben helyes 1/3 3ms 3064 KiB
8 Részben helyes 1/3 3ms 3072 KiB
9 Részben helyes 1/3 3ms 3224 KiB
10 Részben helyes 1/3 3ms 3356 KiB
11 Részben helyes 1/3 3ms 3436 KiB
12 Részben helyes 1/3 3ms 3568 KiB
13 Részben helyes 1/3 3ms 3600 KiB
14 Részben helyes 1/3 3ms 3676 KiB
15 Részben helyes 1/4 3ms 3680 KiB
16 Részben helyes 1/4 3ms 3708 KiB
17 Részben helyes 1/4 3ms 3800 KiB
18 Részben helyes 1/4 3ms 3924 KiB
19 Részben helyes 1/4 3ms 3936 KiB
20 Részben helyes 1/4 3ms 4012 KiB
21 Részben helyes 1/4 3ms 4044 KiB
22 Részben helyes 1/4 3ms 4120 KiB
23 Elfogadva 3/3 3ms 4124 KiB