74122024-01-08 15:59:12szabelrTáblajátékcpp17Partially correct 36/503ms3772 KiB
#include <iostream>

using namespace std;

int main()
{
    long long sor=1,hely=1,k,x,z=1,kettes=0;
    cin>>k;
    for(int i=1; i<=k; i++){
        cin>>x;
        if(x==0)
        {
           sor++;
           hely=hely*2-1;
        }
        if(x==1)
        {
            sor++;
            hely=hely*2;
        }
        if(x==2)
        {
            sor--;
            hely=hely/2+hely%2;
        }
        if(x==3)
        {
            hely--;
        }
        if(x==4)
        {
            hely++;
        }
    }
    cout<<sor-1<<endl;
    hely=hely-1;
    //cout<<hely<<endl;
    while(hely>0){
        kettes=kettes+hely%2*z;
        hely=hely/2;
        z=z*10;
    }
    cout<<kettes;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base36/50
1Accepted0/03ms1744 KiB
2Accepted0/03ms2060 KiB
3Accepted3/33ms2120 KiB
4Accepted3/33ms2412 KiB
5Accepted3/33ms2368 KiB
6Partially correct1/33ms2496 KiB
7Accepted3/33ms2868 KiB
8Partially correct1/33ms3216 KiB
9Accepted3/33ms2960 KiB
10Partially correct1/33ms3152 KiB
11Accepted3/33ms3352 KiB
12Partially correct1/33ms3360 KiB
13Accepted4/43ms3492 KiB
14Partially correct1/43ms3580 KiB
15Accepted4/43ms3640 KiB
16Partially correct1/43ms3644 KiB
17Accepted4/43ms3772 KiB