54222023-05-17 10:12:16TortelliniJrTáblajátékcpp17Wrong answer 28/503ms3624 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((double)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
base28/50
1Accepted0/03ms1812 KiB
2Wrong answer0/03ms2016 KiB
3Accepted3/33ms2228 KiB
4Accepted3/33ms2480 KiB
5Accepted3/33ms2692 KiB
6Partially correct1/33ms2868 KiB
7Accepted3/33ms2988 KiB
8Partially correct1/33ms2984 KiB
9Partially correct1/33ms2956 KiB
10Partially correct1/33ms3068 KiB
11Accepted3/33ms3084 KiB
12Partially correct1/33ms3200 KiB
13Partially correct1/43ms3164 KiB
14Partially correct1/43ms3412 KiB
15Partially correct1/43ms3500 KiB
16Partially correct1/43ms3624 KiB
17Accepted4/43ms3624 KiB