144662025-01-10 22:03:43999Táblajátékcpp17Wrong answer 22/501ms528 KiB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include <string>
using namespace std;
#define int long long

signed main() {
	int k;cin>>k;
	int s=0,h=0;
	for(int i = 0;i<k;i++){
		int a;cin>>a;
		if(a==0){
			s++;
			h*=2;
		}
		else if(a==1){
			s++;
			h*=2;
			h++;
		}
		else if(a==2){
			s--;
			h/=2;
		}
		else if(a==3){
			h--;
		}
		else if(a==4){
			h++;
		}
	}
	cout<<s<<endl;
	string st="";
	if(h==0){
		cout<<0<<endl;
		return 0;
	}
	while(h>0){
		st=to_string(h%2)+st;
		h/=2;
    }
}
SubtaskSumTestVerdictTimeMemory
base22/50
1Wrong answer0/01ms512 KiB
2Wrong answer0/01ms316 KiB
3Accepted3/31ms316 KiB
4Partially correct1/31ms500 KiB
5Partially correct1/31ms316 KiB
6Partially correct1/31ms336 KiB
7Partially correct1/31ms316 KiB
8Partially correct1/31ms316 KiB
9Accepted3/31ms316 KiB
10Partially correct1/31ms528 KiB
11Partially correct1/31ms316 KiB
12Partially correct1/31ms316 KiB
13Partially correct1/41ms316 KiB
14Partially correct1/41ms500 KiB
15Partially correct1/41ms316 KiB
16Partially correct1/41ms316 KiB
17Accepted4/41ms316 KiB