結果

問題 No.2538 2進元ゲーム
ユーザー cho435cho435
提出日時 2023-11-10 23:15:26
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 840 bytes
コンパイル時間 4,629 ms
コンパイル使用メモリ 267,716 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2023-11-10 23:15:33
合計ジャッジ時間 6,150 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 2 ms
6,676 KB
testcase_05 AC 2 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 2 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 2 ms
6,676 KB
testcase_11 AC 2 ms
6,676 KB
testcase_12 AC 2 ms
6,676 KB
testcase_13 AC 1 ms
6,676 KB
testcase_14 AC 1 ms
6,676 KB
testcase_15 AC 2 ms
6,676 KB
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 2 ms
6,676 KB
testcase_18 AC 2 ms
6,676 KB
testcase_19 AC 2 ms
6,676 KB
testcase_20 AC 2 ms
6,676 KB
testcase_21 AC 2 ms
6,676 KB
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 2 ms
6,676 KB
testcase_24 AC 1 ms
6,676 KB
testcase_25 AC 2 ms
6,676 KB
testcase_26 AC 2 ms
6,676 KB
testcase_27 AC 2 ms
6,676 KB
testcase_28 AC 2 ms
6,676 KB
testcase_29 AC 3 ms
6,676 KB
testcase_30 AC 12 ms
6,676 KB
testcase_31 AC 102 ms
6,676 KB
testcase_32 AC 147 ms
6,676 KB
testcase_33 AC 147 ms
6,676 KB
testcase_34 AC 119 ms
6,676 KB
testcase_35 AC 112 ms
6,676 KB
testcase_36 AC 98 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main(){
	int n;
	cin>>n;
	vector<ll> a(n);
	rep(i,n) cin>>a.at(i);
	// A034798
	vector<int> dp={0, 1, 0, 2, 1, 1, 2, 2, 0, 1, 0, 3, 1, 1, 3, 3, 0, 2, 0, 2, 2, 2, 2, 2, 0, 3, 0, 3, 3, 3, 3, 3, 0, 2, 0, 2, 2, 2, 2, 2, 0, 3, 0, 3, 3, 3, 3, 3, 0, 2, 0, 2, 2, 2, 2, 2, 0, 3, 0, 3, 3, 3, 3, 3, 0, 1, 0, 3, 1, 1, 3, 3, 0, 1, 0, 3, 1, 1, 3, 3, 0, 3, 0, 3, 3, 3, 3, 3, 0, 3, 0, 3, 3, 3, 3, 3, 0, 3, 0, 3};
	int d=0;
	int smx=0;
	rep(i,n){
		if(a.at(i)<0){
			d++;
			continue;
		}
		set<int> st;
		rep(j,65){
			if((a.at(i)>>j)&1) st.insert(dp.at(j));
		}
		int mx=0;
		while(st.count(mx)) mx++;
		smx^=mx;
	}
	d%=2;
	if(d&&(smx==0)){
		cout<<"1\n";
		return 0;
	}
	if(smx) cout<<"1\n";
	else cout<<"2\n";
}
0