結果
問題 |
No.2165 Let's Play Nim!
|
ユーザー |
![]() |
提出日時 | 2022-12-16 12:11:29 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 688 bytes |
コンパイル時間 | 220 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 27,976 KB |
平均クエリ数 | 12.10 |
最終ジャッジ日時 | 2024-11-15 17:25:06 |
合計ジャッジ時間 | 10,477 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 2 WA * 20 RE * 15 TLE * 1 |
ソースコード
def main(): N=int(input()) A=list(map(int,input().split())) def f(): t=0 for i in A: t^=i c=0 m=-1 d=0 while t>0: if (t&1): m=c d+=(1<<c) c+=1 t>>=1 for i in range(len(A)): if (A[i]>>m)&1 and A[i]>=d: A[i]-=d return [i+1,d] s=0 for i in A: s^=i if s!=0: print(1,flush=True) print(*f(),flush=True) r=int(input()) if r==-1: return else: print(0,flush=True) while 1: a,b=map(int,input().split()) A[a-1]-=b r=int(input()) if r==-1: return print(*f(),flush=True) r=int(input()) if r==-1: return return main()