結果

問題 No.2813 Cookie
ユーザー 👑 rin204
提出日時 2024-07-19 21:42:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 169 ms / 2,000 ms
コード長 403 bytes
コンパイル時間 221 ms
コンパイル使用メモリ 82,312 KB
実行使用メモリ 77,876 KB
最終ジャッジ日時 2024-07-19 21:42:59
合計ジャッジ時間 4,499 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    A = list(map(int, input().split()))
    x = 0
    for a in A:
        if a <= 2:
            x ^= 1
        elif a <= 4:
            x ^= 2
        else:
            c = (a - 5) // 3
            y = 4 * (c + 1)
            if a % 3 == 1:
                y += 2

            x ^= y
    print("Bob" if x == 0 else "Alice")


for _ in range(int(input())):
    solve()
0