92182024-02-18 18:47:20KristófTáblajáték 2 (70 pont)cpp14Wrong answer 28/703ms4272 KiB
#include <iostream>
#include <vector>
#include <bits/stdc++.h>


using namespace std;
struct poz{

int sor;
int hely;

}typedef poz;

int main()
{
    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++;
        }

    }
    vector <int> harmasr;
    cout<<tabla.sor<<endl;
    int m=0;
    while (tabla.hely!=0){
        harmasr.push_back(tabla.hely%3);
        tabla.hely=tabla.hely/3;

        m++;


    }
    for(int i=harmasr.size()-1;i>-1;i--){
        cout<<harmasr[i];
    }


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base28/70
1Accepted0/03ms1960 KiB
2Wrong answer0/03ms2012 KiB
3Accepted2/23ms2224 KiB
4Partially correct1/33ms2436 KiB
5Accepted3/33ms2652 KiB
6Partially correct1/33ms2732 KiB
7Accepted3/33ms2864 KiB
8Partially correct1/33ms3072 KiB
9Partially correct1/33ms3284 KiB
10Partially correct1/33ms3496 KiB
11Accepted3/33ms3740 KiB
12Partially correct1/33ms3824 KiB
13Partially correct1/33ms3824 KiB
14Partially correct1/33ms3940 KiB
15Partially correct1/43ms3908 KiB
16Partially correct1/43ms3792 KiB
17Partially correct1/43ms3792 KiB
18Partially correct1/43ms3796 KiB
19Partially correct1/43ms3924 KiB
20Partially correct1/43ms4124 KiB
21Partially correct1/43ms4240 KiB
22Partially correct1/43ms4272 KiB
23Partially correct1/33ms4252 KiB