結果

問題 No.2538 2進元ゲーム
ユーザー hiro1729hiro1729
提出日時 2023-08-17 14:17:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,283 ms / 2,000 ms
コード長 306 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,908 KB
実行使用メモリ 20,104 KB
最終ジャッジ日時 2023-10-01 01:48:52
合計ジャッジ時間 6,553 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,604 KB
testcase_01 AC 21 ms
8,788 KB
testcase_02 AC 19 ms
8,664 KB
testcase_03 AC 20 ms
8,672 KB
testcase_04 AC 20 ms
8,660 KB
testcase_05 AC 20 ms
8,716 KB
testcase_06 AC 19 ms
8,624 KB
testcase_07 AC 20 ms
8,592 KB
testcase_08 AC 20 ms
8,632 KB
testcase_09 AC 20 ms
8,596 KB
testcase_10 AC 19 ms
8,664 KB
testcase_11 AC 20 ms
8,592 KB
testcase_12 AC 20 ms
8,664 KB
testcase_13 AC 20 ms
8,756 KB
testcase_14 AC 20 ms
8,688 KB
testcase_15 AC 22 ms
8,680 KB
testcase_16 AC 20 ms
8,736 KB
testcase_17 AC 20 ms
8,604 KB
testcase_18 AC 19 ms
8,728 KB
testcase_19 AC 20 ms
8,716 KB
testcase_20 AC 20 ms
8,660 KB
testcase_21 AC 19 ms
8,760 KB
testcase_22 AC 20 ms
8,604 KB
testcase_23 AC 20 ms
8,592 KB
testcase_24 AC 19 ms
8,632 KB
testcase_25 AC 20 ms
8,584 KB
testcase_26 AC 20 ms
8,720 KB
testcase_27 AC 20 ms
8,744 KB
testcase_28 AC 20 ms
8,560 KB
testcase_29 AC 25 ms
8,756 KB
testcase_30 AC 71 ms
10,032 KB
testcase_31 AC 362 ms
19,864 KB
testcase_32 AC 1,179 ms
19,856 KB
testcase_33 AC 1,283 ms
20,104 KB
testcase_34 AC 99 ms
20,000 KB
testcase_35 AC 1,239 ms
19,960 KB
testcase_36 AC 104 ms
19,184 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache
@lru_cache(maxsize=10000)
def g(n):
	f=[0]*60
	d=0
	m=n
	while m!=0:
		if m%2==1:f[g(d)]=1
		d+=1
		m>>=1
	a=0
	while f[a]==1:a+=1
	return a
i=input
N=range(int(i()))
e=1
a=0
A=i().split()
for n in N:
	B=int(A[n])
	if B<0:e=1-e
	else:a^=g(B)
print(2 if e==1 and a==0 else 1)
0