結果

問題 No.2165 Let's Play Nim!
ユーザー titiatitia
提出日時 2022-12-16 02:05:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 332 ms / 2,000 ms
コード長 672 bytes
コンパイル時間 482 ms
コンパイル使用メモリ 86,960 KB
実行使用メモリ 94,372 KB
平均クエリ数 863.56
最終ジャッジ日時 2023-08-09 11:15:20
合計ジャッジ時間 26,764 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 102 ms
87,800 KB
testcase_01 AC 270 ms
93,772 KB
testcase_02 AC 281 ms
93,864 KB
testcase_03 AC 223 ms
94,264 KB
testcase_04 AC 100 ms
87,480 KB
testcase_05 AC 120 ms
91,872 KB
testcase_06 AC 118 ms
91,816 KB
testcase_07 AC 114 ms
91,928 KB
testcase_08 AC 233 ms
94,372 KB
testcase_09 AC 102 ms
87,384 KB
testcase_10 AC 135 ms
92,680 KB
testcase_11 AC 279 ms
94,028 KB
testcase_12 AC 262 ms
93,684 KB
testcase_13 AC 99 ms
87,176 KB
testcase_14 AC 114 ms
91,668 KB
testcase_15 AC 101 ms
86,968 KB
testcase_16 AC 256 ms
93,792 KB
testcase_17 AC 194 ms
94,180 KB
testcase_18 AC 332 ms
93,868 KB
testcase_19 AC 101 ms
86,864 KB
testcase_20 AC 113 ms
91,804 KB
testcase_21 AC 180 ms
93,900 KB
testcase_22 AC 166 ms
93,892 KB
testcase_23 AC 160 ms
94,104 KB
testcase_24 AC 147 ms
92,624 KB
testcase_25 AC 215 ms
93,392 KB
testcase_26 AC 283 ms
93,372 KB
testcase_27 AC 167 ms
93,836 KB
testcase_28 AC 199 ms
93,896 KB
testcase_29 AC 98 ms
87,136 KB
testcase_30 AC 97 ms
87,760 KB
testcase_31 AC 97 ms
86,888 KB
testcase_32 AC 247 ms
93,876 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()))

XOR=0
for a in A:
    XOR^=a

if XOR==0:
    print(0,flush=True)

    i,k=map(int,input().split())
    XOR^=A[i-1]
    A[i-1]-=k
    XOR^=A[i-1]
    ret=int(input())
    if ret==-1:
        exit()
else:
    print(1,flush=True)

while True:
    for i in range(n):
        if A[i]^XOR<A[i]:
            nec=A[i]^XOR

            print(i+1,A[i]-nec,flush=True)
            A[i]=nec
            XOR=0
            ret=int(input())
            if ret==-1:
                exit()

            break

    i,k=map(int,input().split())
    XOR^=A[i-1]
    A[i-1]-=k
    XOR^=A[i-1]
    ret=int(input())
    if ret==-1:
        exit()
0