54212023-05-17 09:55:49TortelliniJrTáblajátékcpp17Wrong answer 23/503ms4012 KiB

#include <iostream>
#include <vector>
#include <array>
#include <cmath>
#include <string>

using namespace std;

int main()
{
    int n, s, o, j;
	s = 1;
	o = 1;
    cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> j;
		switch (j)
		{
		case 0:
			s++;
			o *= 2;
			o--;
			break;
		case 1:
			s++, o *= 2;
			break;
		case 2:
			s--;
			o = ceil(o / 2);
		case 3:
			o--;
		case 4:
			o++;
		}
	}
	o--;
	s--;
	string t;
	if (o == 0)
	{
		t = "0";
	}
	while (o != 0)
	{
		t = to_string(o % 2) + t;
		o /= 2;
	}
	cout << s << endl;
	cout << t << endl;
}
SubtaskSumTestVerdictTimeMemory
base23/50
1Wrong answer0/03ms1812 KiB
2Wrong answer0/03ms2004 KiB
3Accepted3/32ms2220 KiB
4Accepted3/33ms2432 KiB
5Accepted3/33ms2676 KiB
6Partially correct1/33ms2884 KiB
7Partially correct1/33ms3416 KiB
8Partially correct1/33ms3332 KiB
9Partially correct1/32ms3372 KiB
10Partially correct1/33ms3400 KiB
11Accepted3/33ms3612 KiB
12Partially correct1/32ms3612 KiB
13Partially correct1/43ms3612 KiB
14Partially correct1/43ms3676 KiB
15Partially correct1/42ms3680 KiB
16Partially correct1/43ms3804 KiB
17Partially correct1/43ms4012 KiB