結果

問題 No.2521 Don't be Same
ユーザー 👑 rin204rin204
提出日時 2023-10-27 22:19:26
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 784 bytes
コンパイル時間 182 ms
コンパイル使用メモリ 81,892 KB
実行使用メモリ 82,428 KB
平均クエリ数 2.57
最終ジャッジ日時 2023-10-27 22:19:31
合計ジャッジ時間 4,992 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 RE -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 97 ms
69,808 KB
testcase_11 AC 93 ms
69,808 KB
testcase_12 AC 96 ms
69,808 KB
testcase_13 AC 95 ms
69,808 KB
testcase_14 AC 93 ms
69,808 KB
testcase_15 AC 94 ms
69,808 KB
testcase_16 AC 94 ms
69,808 KB
testcase_17 AC 96 ms
69,808 KB
testcase_18 AC 94 ms
69,808 KB
testcase_19 AC 97 ms
69,808 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 == 0:
            ask("A", t + 1, X[t] - X[1 - t] + 1)
        else:
            ask("A", t + 1, X[t] - X[1 - t] - 1)
0