7732022-01-10 15:25:56Kevinke12Táblajátékcpp14Wrong answer 22/502ms1996 KiB
#include <iostream>
#include <bits/stdc++.h>
using namespace std;


long long N, aktO=0, l, ans1=0;
vector<char> almafa;
void Konv()
{
    almafa.clear();
    while(aktO>0)
    {
        if(aktO%2==1)
            almafa.push_back('1');
        else
            almafa.push_back('0');
        aktO/=2;
    }
}
int main()
{
    cin >> N;
    for(int i = 0; i < N; i++)
    {
        cin >> l;
        if((l==0) ||(l==1)) ans1++;
        if(l==2) ans1--;

        if(l==0)
            aktO = aktO*2;
         if(l==1)
            aktO = aktO*2+1;
         if(l==2) //fel
            aktO = aktO/2;
         if(l==3)
            aktO--;
         if(l==4)
            aktO++;

        //cout << ans1 << " " << aktO << "\n";

    }
    cout << ans1 << "\n";

    cout << aktO << "\n";
    Konv();
    reverse(almafa.begin(), almafa.end());
    for(char c:almafa)
        cout << c;
    if(almafa.size()==0)
        cout << "0";


    return 0;
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Wrong answer0/02ms1812 KiB
2Wrong answer0/01ms1916 KiB
3Accepted3/31ms1940 KiB
4Partially correct1/31ms1948 KiB
5Partially correct1/32ms1956 KiB
6Partially correct1/31ms1956 KiB
7Partially correct1/31ms1956 KiB
8Partially correct1/31ms1964 KiB
9Accepted3/31ms1972 KiB
10Partially correct1/31ms1972 KiB
11Partially correct1/32ms1976 KiB
12Partially correct1/31ms1976 KiB
13Partially correct1/41ms1984 KiB
14Partially correct1/41ms1984 KiB
15Partially correct1/41ms1996 KiB
16Partially correct1/41ms1996 KiB
17Accepted4/42ms1996 KiB