結果

問題 No.2521 Don't be Same
ユーザー titiatitia
提出日時 2023-11-02 00:48:01
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 130 ms / 2,000 ms
コード長 1,022 bytes
コンパイル時間 202 ms
コンパイル使用メモリ 12,000 KB
実行使用メモリ 26,608 KB
平均クエリ数 9.61
最終ジャッジ日時 2023-11-02 00:48:06
合計ジャッジ時間 5,535 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
26,608 KB
testcase_01 AC 97 ms
26,608 KB
testcase_02 AC 99 ms
26,608 KB
testcase_03 AC 99 ms
26,608 KB
testcase_04 AC 99 ms
26,608 KB
testcase_05 AC 98 ms
26,608 KB
testcase_06 AC 96 ms
26,608 KB
testcase_07 AC 96 ms
26,608 KB
testcase_08 AC 98 ms
26,608 KB
testcase_09 AC 123 ms
26,608 KB
testcase_10 AC 96 ms
26,608 KB
testcase_11 AC 99 ms
26,608 KB
testcase_12 AC 96 ms
26,608 KB
testcase_13 AC 96 ms
26,608 KB
testcase_14 AC 96 ms
26,608 KB
testcase_15 AC 95 ms
26,608 KB
testcase_16 AC 96 ms
26,608 KB
testcase_17 AC 94 ms
26,608 KB
testcase_18 AC 112 ms
26,608 KB
testcase_19 AC 94 ms
26,608 KB
testcase_20 AC 99 ms
26,608 KB
testcase_21 AC 95 ms
26,608 KB
testcase_22 AC 99 ms
26,608 KB
testcase_23 AC 97 ms
26,608 KB
testcase_24 AC 97 ms
26,608 KB
testcase_25 AC 98 ms
26,608 KB
testcase_26 AC 127 ms
26,608 KB
testcase_27 AC 130 ms
26,608 KB
権限があれば一括ダウンロードができます

ソースコード

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",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

    

    
    
0