結果

問題 No.2521 Don't be Same
ユーザー rin204rin204
提出日時 2023-10-27 22:18:23
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 713 ms
コンパイル使用メモリ 81,548 KB
実行使用メモリ 69,808 KB
平均クエリ数 2.14
最終ジャッジ日時 2023-10-27 22:18:30
合計ジャッジ時間 5,570 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

X = list(map(int, input().split()))


def f():
    res = input().split()
    if res[0] == "A":
        X[int(res[1]) - 1] -= int(res[2])
    elif res[0] == "B":
        exit()
    else:
        exit()


def ask(Q, i=None, j=None):
    global X
    if Q == "A":
        print("A", i, j, flush=True)
        X[i - 1] -= j
    else:
        print("B", flush=True)
        X = [0, 0]
    f()


if abs(X[0] - X[1]) == 1 and min(X) % 2 == 1:
    print("Second", flush=True)
    f()
else:
    print("First", flush=True)

while 1:
    if X[0] == X[1]:
        ask("B")
    else:
        if X[0] <= X[1]:
            t = 1
        else:
            t = 0
        if X[t] % 2 == 1:
            ask("A", t + 1, X[t] - X[1 - t] + 1)
        else:
            ask("A", t + 1, X[t] - X[1 - t] - 1)
0