結果
問題 | No.2521 Don't be Same |
ユーザー | titia |
提出日時 | 2023-11-02 00:48:01 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 96 ms / 2,000 ms |
コード長 | 1,022 bytes |
コンパイル時間 | 334 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 27,736 KB |
平均クエリ数 | 10.14 |
最終ジャッジ日時 | 2024-09-25 18:03:36 |
合計ジャッジ時間 | 4,239 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 27 |
ソースコード
import sys input = sys.stdin.readline A=list(map(int,input().split())) if min(A)%2==1 and max(A)==min(A)+1: print("Second",flush=True) else: print("First",flush=True) while True: if A[0]==A[1]: print("B",flush=True) elif A[0]==0: print("A",2,A[1],flush=True) A[1]=0 elif A[1]==0: print("A",1,A[0],flush=True) A[0]=0 else: if A[0]%2==1 and A[1]>A[0]+1: print("A",2,A[1]-(A[0]+1),flush=True) A[1]=A[0]+1 elif A[0]%2==0 and A[1]>A[0]-1: print("A",2,A[1]-(A[0]-1),flush=True) A[1]=A[0]-1 elif A[1]%2==1 and A[0]>A[1]+1: print("A",1,A[0]-(A[1]+1),flush=True) A[0]=A[1]+1 elif A[1]%2==0 and A[0]>A[1]-1: print("A",1,A[0]-(A[1]-1),flush=True) A[0]=A[1]-1 ans=input().strip() if ans=="C" or ans=="D": exit() com,x,y=ans.split() x=int(x)-1 y=int(y) A[x]-=y