結果

問題 No.2165 Let's Play Nim!
ユーザー meruuu61779999meruuu61779999
提出日時 2023-04-13 00:25:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 305 ms / 2,000 ms
コード長 690 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 82,564 KB
実行使用メモリ 93,720 KB
平均クエリ数 863.56
最終ジャッジ日時 2024-04-17 09:02:26
合計ジャッジ時間 24,847 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
68,704 KB
testcase_01 AC 237 ms
93,384 KB
testcase_02 AC 244 ms
93,248 KB
testcase_03 AC 193 ms
92,712 KB
testcase_04 AC 62 ms
69,960 KB
testcase_05 AC 82 ms
78,664 KB
testcase_06 AC 80 ms
78,024 KB
testcase_07 AC 77 ms
76,744 KB
testcase_08 AC 198 ms
93,648 KB
testcase_09 AC 70 ms
69,456 KB
testcase_10 AC 101 ms
85,584 KB
testcase_11 AC 244 ms
93,584 KB
testcase_12 AC 224 ms
93,640 KB
testcase_13 AC 62 ms
69,092 KB
testcase_14 AC 79 ms
77,256 KB
testcase_15 AC 65 ms
70,088 KB
testcase_16 AC 218 ms
93,384 KB
testcase_17 AC 157 ms
93,720 KB
testcase_18 AC 305 ms
93,640 KB
testcase_19 AC 61 ms
69,584 KB
testcase_20 AC 76 ms
77,240 KB
testcase_21 AC 148 ms
92,888 KB
testcase_22 AC 132 ms
92,760 KB
testcase_23 AC 122 ms
90,584 KB
testcase_24 AC 110 ms
87,256 KB
testcase_25 AC 183 ms
93,304 KB
testcase_26 AC 255 ms
93,508 KB
testcase_27 AC 133 ms
92,524 KB
testcase_28 AC 168 ms
93,256 KB
testcase_29 AC 61 ms
68,832 KB
testcase_30 AC 60 ms
68,192 KB
testcase_31 AC 59 ms
68,960 KB
testcase_32 AC 218 ms
93,280 KB
evil_2_big_1.txt TLE -
evil_2_big_2.txt TLE -
evil_2_big_3.txt TLE -
evil_big_1.txt TLE -
evil_big_2.txt TLE -
evil_big_3.txt TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))

nim = 0
for a in A:
    nim ^= a
t = 1 if nim else 0
print(t, flush=True)
if t == 0:
    idx, k = map(int, input().split())
    idx -= 1
    nim = A[idx]
    A[idx] -= k
    nim ^= A[idx]

    ret = int(input())
    if ret == -1:
        exit()

while True:
    for i, a in enumerate(A):
        na = a ^ nim
        if na < a:
            A[i] -= a - na
            print(i + 1, a - na, flush=True)
            break

    ret = int(input())
    if ret == -1:
        exit()

    idx, k = map(int, input().split())
    idx -= 1
    nim = A[idx]
    A[idx] -= k
    nim ^= A[idx]

    ret = int(input())
    if ret == -1:
        exit()
0