結果

問題 No.2521 Don't be Same
ユーザー 👑 rin204rin204
提出日時 2023-10-27 22:20:19
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 788 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 82,356 KB
平均クエリ数 10.04
最終ジャッジ日時 2023-10-27 22:20:25
合計ジャッジ時間 5,769 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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