結果
| 問題 |
No.2165 Let's Play Nim!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-16 02:04:44 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 639 bytes |
| コンパイル時間 | 376 ms |
| コンパイル使用メモリ | 82,132 KB |
| 実行使用メモリ | 93,552 KB |
| 平均クエリ数 | 650.69 |
| 最終ジャッジ日時 | 2024-11-14 18:52:39 |
| 合計ジャッジ時間 | 50,449 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 |
| other | AC * 25 TLE * 13 |
ソースコード
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
x = 0
for ai in a:
x ^= ai
t = 1 if x!=0 else 0
print(t)
turn = 0
while True:
if turn^t:
for i in range(n):
if a[i]>x^a[i]:
k = a[i]-(x^a[i])
print(i+1, k)
sys.stdout.flush()
x ^= a[i]
a[i] -= k
x ^= a[i]
break
else:
i, k = map(int, input().split())
x ^= a[i-1]
a[i-1] -= k
x ^= a[i-1]
ret = int(input())
if ret==-1:
exit()
turn ^= 1