92162024-02-18 18:12:56KristófTáblajáték 2 (70 pont)cpp14Wrong answer 23/703ms4124 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;
}
SubtaskSumTestVerdictTimeMemory
base23/70
1Accepted0/03ms1872 KiB
2Wrong answer0/03ms2120 KiB
3Partially correct1/23ms2296 KiB
4Partially correct1/33ms2544 KiB
5Partially correct1/33ms2652 KiB
6Partially correct1/33ms2860 KiB
7Partially correct1/33ms3064 KiB
8Partially correct1/33ms3072 KiB
9Partially correct1/33ms3224 KiB
10Partially correct1/33ms3356 KiB
11Partially correct1/33ms3436 KiB
12Partially correct1/33ms3568 KiB
13Partially correct1/33ms3600 KiB
14Partially correct1/33ms3676 KiB
15Partially correct1/43ms3680 KiB
16Partially correct1/43ms3708 KiB
17Partially correct1/43ms3800 KiB
18Partially correct1/43ms3924 KiB
19Partially correct1/43ms3936 KiB
20Partially correct1/43ms4012 KiB
21Partially correct1/43ms4044 KiB
22Partially correct1/43ms4120 KiB
23Accepted3/33ms4124 KiB