結果
問題 | No.2813 Cookie |
ユーザー | minimum |
提出日時 | 2024-07-19 22:42:16 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 177 ms / 2,000 ms |
コード長 | 580 bytes |
コンパイル時間 | 278 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 77,824 KB |
最終ジャッジ日時 | 2024-07-19 22:42:22 |
合計ジャッジ時間 | 4,715 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 30 |
ソースコード
def solve(): N = int(input()) A = list(map(int, input().split())) grs = [] for i in A: if i == 1 or i == 2: grs.append(1) elif i == 3: grs.append(2) elif i % 3 == 1: grs.append(4 * (i // 3) - 2) elif i % 3 == 2: grs.append(4 * (i // 3)) else: grs.append(4 * ((i - 1) // 3)) # print(b) c = 0 for i in grs: c ^= i if c > 0: print("Alice") else: print("Bob") # print(c) T = int(input()) for _ in range(T): solve()