8172022-01-17 11:31:14zsebiTáblajátékcpp11Wrong answer 0/502ms2036 KiB
//#include <iostream>
#include <fstream>

using namespace std;

ifstream cin("tablajatek.in");
ofstream cout("tablajatek.out");

int x[100001],a,sor,szam,i,j,n;
int main()
{
    cin>>n;
    sor=0;
    szam=0;

    for(i=1;i<=n;++i)
    {
        cin>>a;


        if(a<=1)
        {
            sor++;
            szam=szam*2+a;

        }

        else if(a==2)
        {
           sor--;
           szam=szam/2;

        }
        else if(a==3)
        {
            szam--;
        }
        else if (a==4)
        {
            szam++;
        }

    }

    cout<<sor<<"\n";
    i=1;
    while(szam)
    {

        x[i]=szam%2;
        szam=szam/2;
        i++;

    }
    for(j=i-1;j>=1;--j)cout<<x[j];
    return 0;
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/02ms1932 KiB
2Wrong answer0/01ms1968 KiB
3Wrong answer0/31ms2028 KiB
4Wrong answer0/32ms2028 KiB
5Wrong answer0/32ms2032 KiB
6Wrong answer0/31ms2028 KiB
7Wrong answer0/31ms2032 KiB
8Wrong answer0/31ms1928 KiB
9Wrong answer0/31ms2032 KiB
10Wrong answer0/31ms2032 KiB
11Wrong answer0/31ms2028 KiB
12Wrong answer0/31ms2028 KiB
13Wrong answer0/41ms1932 KiB
14Wrong answer0/41ms2028 KiB
15Wrong answer0/41ms2036 KiB
16Wrong answer0/41ms2032 KiB
17Wrong answer0/41ms1928 KiB