9214 2024. 02. 18 18:11:40 Kristóf Táblajáték 2 (70 pont) cpp17 Hibás válasz 23/70 3ms 3960 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;
    }
    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 1880 KiB
2 Hibás válasz 0/0 3ms 2112 KiB
3 Részben helyes 1/2 3ms 2364 KiB
4 Részben helyes 1/3 3ms 2608 KiB
5 Részben helyes 1/3 2ms 2696 KiB
6 Részben helyes 1/3 3ms 3104 KiB
7 Részben helyes 1/3 3ms 3184 KiB
8 Részben helyes 1/3 3ms 3312 KiB
9 Részben helyes 1/3 3ms 3516 KiB
10 Részben helyes 1/3 3ms 3544 KiB
11 Részben helyes 1/3 3ms 3544 KiB
12 Részben helyes 1/3 3ms 3556 KiB
13 Részben helyes 1/3 3ms 3808 KiB
14 Részben helyes 1/3 3ms 3708 KiB
15 Részben helyes 1/4 2ms 3712 KiB
16 Részben helyes 1/4 3ms 3720 KiB
17 Részben helyes 1/4 3ms 3728 KiB
18 Részben helyes 1/4 3ms 3816 KiB
19 Részben helyes 1/4 3ms 3740 KiB
20 Részben helyes 1/4 3ms 3736 KiB
21 Részben helyes 1/4 3ms 3868 KiB
22 Részben helyes 1/4 3ms 3948 KiB
23 Elfogadva 3/3 3ms 3960 KiB