54242023-05-17 10:48:14TortelliniJrTáblajátékcpp17Wrong answer 26/50300ms3624 KiB

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

using namespace std;

int main()
{
    int n, s, o, j;
	o = 0;
	s = 0;
    cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> j;
		switch (j)
		{
		case 0:
			s++;
			o *= 2;
			break;
		case 1:
			s++, o *= 2, o++;
			break;
		case 2:
			s--;
			o = o / 2;
		case 3:
			o--;
		case 4:
			o++;
		}
	}
	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
base26/50
1Accepted0/03ms1808 KiB
2Wrong answer0/03ms2004 KiB
3Accepted3/33ms2252 KiB
4Accepted3/33ms2468 KiB
5Accepted3/33ms2576 KiB
6Partially correct1/33ms2780 KiB
7Accepted3/32ms2860 KiB
8Time limit exceeded0/3300ms2460 KiB
9Partially correct1/32ms3080 KiB
10Partially correct1/33ms3080 KiB
11Accepted3/32ms3072 KiB
12Partially correct1/32ms3100 KiB
13Partially correct1/42ms3080 KiB
14Time limit exceeded0/4300ms2736 KiB
15Partially correct1/43ms3244 KiB
16Partially correct1/43ms3416 KiB
17Accepted4/43ms3624 KiB