結果
| 問題 |
No.2538 2進元ゲーム
|
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-11-10 23:05:03 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 634 bytes |
| コンパイル時間 | 241 ms |
| コンパイル使用メモリ | 82,176 KB |
| 実行使用メモリ | 94,844 KB |
| 最終ジャッジ日時 | 2024-09-26 02:09:09 |
| 合計ジャッジ時間 | 4,026 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 26 WA * 11 |
ソースコード
N = int(input())
A = list(map(int, input().split()))
cnt = 0
for a in A:
if a < 0 and a % 2:
cnt += 1
if cnt:
print(1) if cnt % 2 else print(2)
exit()
M = 65
dp = [-1] * M
dp[0] = 0
for i in range(M):
S = set()
for j in range(10):
if (i >> j) & 1:
S.add(dp[j])
now = 0
while now in S:
now += 1
dp[i] = now
ans = 0
for i in range(N):
S = set()
if A[i] < 0:
continue
for j in range(M):
if (A[i] >> j) & 1:
S.add(dp[j])
now = 0
while now in S:
now += 1
ans ^= now
print(1) if ans else print(2)
rlangevin