79702024-01-12 09:29:32CsongiTáblajátékcpp17Wrong answer 3/503ms4100 KiB
#include <iostream>
#include <bits/stdc++.h>
#include <bitset>

using namespace std;


void binaris(unsigned long int n)
{
    if (n / 2 != 0) {
        binaris(n / 2);
    }
    printf("%d", n % 2);
}

int main()
{
    short int k;
    cin >> k;
    vector<short int> szamok(k);
    unsigned long int jelenmezo = 0;
    double jelensor = 0;
    for (short int i = 0; i < k; i++)
    {
        cin >> szamok[i];
        switch (szamok[i])
        {
        case 0:
            jelensor++;
            if (jelenmezo != 0)
                jelenmezo *= 2;
            break;
        case 1:
            jelensor++;
            jelenmezo = (jelenmezo*2)+1;
            break;
        case 2:
            jelenmezo = ceil(jelenmezo / 2);
            jelensor--;
            break;
        case 3:
            if (jelenmezo != 0)
                jelenmezo--;
            break;
        case 4:
            jelenmezo++;
            break;
        }
    }
    binaris(jelenmezo);
    cout << jelensor << endl;
}
SubtaskSumTestVerdictTimeMemory
base3/50
1Wrong answer0/03ms1876 KiB
2Wrong answer0/03ms2072 KiB
3Partially correct1/33ms2284 KiB
4Wrong answer0/33ms2492 KiB
5Wrong answer0/33ms2708 KiB
6Wrong answer0/32ms2792 KiB
7Wrong answer0/33ms2916 KiB
8Wrong answer0/33ms3156 KiB
9Partially correct1/33ms3212 KiB
10Wrong answer0/33ms3344 KiB
11Wrong answer0/33ms3560 KiB
12Wrong answer0/33ms3560 KiB
13Wrong answer0/43ms3736 KiB
14Wrong answer0/43ms3764 KiB
15Wrong answer0/43ms4008 KiB
16Wrong answer0/43ms4092 KiB
17Partially correct1/43ms4100 KiB