結果

問題 No.2521 Don't be Same
コンテスト
ユーザー titia
提出日時 2023-11-02 00:42:37
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
RE  
実行時間 -
コード長 1,054 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 499 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 40,792 KB
平均クエリ数 2.96
最終ジャッジ日時 2026-04-12 21:51:02
合計ジャッジ時間 8,979 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 10 WA * 3 RE * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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[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