54202023-05-17 09:32:35TortelliniJrTáblajátékcpp17Wrong answer 17/503ms4104 KiB

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

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++;
		}
	}
	cout << s - 1 << endl;
	cout << o - 1 << endl;
}
SubtaskSumTestVerdictTimeMemory
base17/50
1Wrong answer0/03ms1876 KiB
2Wrong answer0/03ms2128 KiB
3Accepted3/32ms2204 KiB
4Partially correct1/33ms2332 KiB
5Partially correct1/32ms2364 KiB
6Partially correct1/33ms2492 KiB
7Partially correct1/33ms2740 KiB
8Partially correct1/33ms2944 KiB
9Partially correct1/33ms3156 KiB
10Partially correct1/33ms3428 KiB
11Partially correct1/33ms3464 KiB
12Partially correct1/33ms3540 KiB
13Partially correct1/43ms3756 KiB
14Partially correct1/43ms3880 KiB
15Partially correct1/43ms3968 KiB
16Partially correct1/43ms3964 KiB
17Partially correct1/43ms4104 KiB