結果

問題 No.2521 Don't be Same
ユーザー titiatitia
提出日時 2023-11-02 00:41:52
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,032 bytes
コンパイル時間 269 ms
コンパイル使用メモリ 11,912 KB
実行使用メモリ 96,960 KB
最終ジャッジ日時 2023-11-02 00:42:00
合計ジャッジ時間 7,246 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

    

    
    
0