結果
問題 |
No.2521 Don't be Same
|
ユーザー |
![]() |
提出日時 | 2023-11-02 00:41:52 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 1,032 bytes |
コンパイル時間 | 126 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 17,696 KB |
最終ジャッジ日時 | 2024-09-25 18:03:18 |
合計ジャッジ時間 | 6,528 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | TLE * 1 |
other | -- * 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") else: print("First") 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[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[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[1]-=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[1]-=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