74132024-01-08 16:01:57szabelrTáblajátékcpp17Partially correct 36/503ms3684 KiB
#include <iostream>

using namespace std;
long long sor=1,hely=1,k,x,z=1,kettes=0;

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/03ms1748 KiB
2Accepted0/03ms1996 KiB
3Accepted3/32ms2076 KiB
4Accepted3/33ms2204 KiB
5Accepted3/33ms2364 KiB
6Partially correct1/33ms2420 KiB
7Accepted3/33ms2536 KiB
8Partially correct1/33ms2428 KiB
9Accepted3/33ms2672 KiB
10Partially correct1/33ms2880 KiB
11Accepted3/33ms2976 KiB
12Partially correct1/33ms3204 KiB
13Accepted4/43ms3256 KiB
14Partially correct1/43ms3616 KiB
15Accepted4/43ms3664 KiB
16Partially correct1/43ms3684 KiB
17Accepted4/43ms3676 KiB