74092024-01-08 15:53:11szabelrTáblajátékcpp17Wrong answer 27/503ms3180 KiB
#include <iostream>

using namespace std;

int main()
{
    int sor=1,hely=1,k,x,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;
    while(hely>0){
        kettes=kettes*10+hely%2;
        hely=hely/2;
    }
    cout<<kettes*10;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base27/50
1Accepted0/03ms2032 KiB
2Wrong answer0/03ms2080 KiB
3Accepted3/33ms2272 KiB
4Partially correct1/33ms2632 KiB
5Partially correct1/33ms2640 KiB
6Partially correct1/33ms2640 KiB
7Accepted3/33ms2668 KiB
8Partially correct1/33ms2860 KiB
9Accepted3/33ms2780 KiB
10Partially correct1/33ms2776 KiB
11Partially correct1/33ms2780 KiB
12Partially correct1/33ms2780 KiB
13Accepted4/43ms2780 KiB
14Partially correct1/43ms2784 KiB
15Partially correct1/43ms2932 KiB
16Partially correct1/43ms2980 KiB
17Accepted4/43ms3180 KiB