結果

問題 No.1439 Let's Compare!!!!
ユーザー ThetaTheta
提出日時 2022-10-14 16:59:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 1,097 bytes
コンパイル時間 641 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 17,568 KB
最終ジャッジ日時 2023-09-08 19:45:31
合計ジャッジ時間 7,320 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
12,316 KB
testcase_01 AC 15 ms
7,820 KB
testcase_02 AC 15 ms
7,784 KB
testcase_03 AC 15 ms
7,932 KB
testcase_04 AC 16 ms
7,724 KB
testcase_05 AC 15 ms
7,796 KB
testcase_06 AC 15 ms
7,784 KB
testcase_07 AC 35 ms
8,284 KB
testcase_08 AC 50 ms
8,416 KB
testcase_09 AC 26 ms
8,204 KB
testcase_10 AC 1,177 ms
13,064 KB
testcase_11 TLE -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def judge_which_larger(compare: list[str]) -> str:
    for mark in compare:
        if mark == "=":
            continue
        return mark
    return "="


def main():
    _ = input()
    S = list(map(int, str(input())))
    T = list(map(int, str(input())))
    S_T_compare = []
    for s_num, t_num in zip(S, T):
        if s_num > t_num:
            S_T_compare.append(">")
        elif s_num == t_num:
            S_T_compare.append("=")
        else:
            S_T_compare.append("<")

    for _ in range(int(input())):
        which_num, digit, number = input().split()
        digit = int(digit)
        number = int(number)
        if which_num == "S":
            S[digit-1] = number
        elif which_num == "T":
            T[digit-1] = number
        else:
            raise ValueError

        if S[digit-1] > T[digit-1]:
            S_T_compare[digit-1] = ">"
        elif S[digit-1] == T[digit-1]:
            S_T_compare[digit-1] = "="
        else:
            S_T_compare[digit-1] = "<"

        print(judge_which_larger(S_T_compare))


if __name__ == "__main__":
    main()
0