結果
| 問題 |
No.2165 Let's Play Nim!
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-16 02:04:01 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 604 bytes |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 82,100 KB |
| 実行使用メモリ | 93,496 KB |
| 最終ジャッジ日時 | 2024-11-14 18:50:09 |
| 合計ジャッジ時間 | 121,754 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | TLE * 1 |
| other | TLE * 38 |
ソースコード
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)
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