結果

問題 No.2813 Cookie
ユーザー minimumminimum
提出日時 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
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
51,584 KB
testcase_01 AC 146 ms
77,724 KB
testcase_02 AC 156 ms
77,056 KB
testcase_03 AC 141 ms
77,696 KB
testcase_04 AC 177 ms
77,236 KB
testcase_05 AC 168 ms
77,824 KB
testcase_06 AC 152 ms
77,568 KB
testcase_07 AC 176 ms
77,184 KB
testcase_08 AC 154 ms
77,440 KB
testcase_09 AC 169 ms
77,392 KB
testcase_10 AC 174 ms
77,184 KB
testcase_11 AC 82 ms
76,416 KB
testcase_12 AC 70 ms
75,520 KB
testcase_13 AC 81 ms
75,776 KB
testcase_14 AC 83 ms
75,648 KB
testcase_15 AC 80 ms
75,648 KB
testcase_16 AC 83 ms
76,032 KB
testcase_17 AC 85 ms
76,160 KB
testcase_18 AC 79 ms
75,264 KB
testcase_19 AC 80 ms
75,392 KB
testcase_20 AC 82 ms
75,904 KB
testcase_21 AC 86 ms
76,160 KB
testcase_22 AC 81 ms
75,776 KB
testcase_23 AC 78 ms
75,520 KB
testcase_24 AC 78 ms
75,904 KB
testcase_25 AC 83 ms
75,776 KB
testcase_26 AC 42 ms
51,840 KB
testcase_27 AC 41 ms
51,840 KB
testcase_28 AC 40 ms
51,968 KB
testcase_29 AC 40 ms
52,096 KB
testcase_30 AC 41 ms
51,712 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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()
0