結果

問題 No.1439 Let's Compare!!!!
ユーザー gorugo30gorugo30
提出日時 2021-03-26 21:58:32
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,221 bytes
コンパイル時間 357 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 103,296 KB
最終ジャッジ日時 2024-05-06 15:28:36
合計ジャッジ時間 6,564 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
57,728 KB
testcase_01 AC 37 ms
51,968 KB
testcase_02 AC 36 ms
51,840 KB
testcase_03 AC 38 ms
52,224 KB
testcase_04 AC 37 ms
52,352 KB
testcase_05 WA -
testcase_06 AC 38 ms
51,968 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 245 ms
97,448 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 362 ms
98,132 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

N = int(input())
S = list(input().rstrip("\n"))
T = list(input().rstrip("\n"))
Q = int(input())

tigauketa = N
for i in range(N):
    if S[i] != T[i]:
        tigauketa = i
        break
if S > T:
    prevans = ">"
elif S == T:
    prevans = "="
else:
    prevans = "<"
for iii in range(Q):
    c, x, y = input().split()
    x = int(x) - 1
    if c == "S":
        S[x] = y
    else:
        T[x] = y
    if x <= tigauketa:
        if S[x] == T[x]:
            tigauketa = N
            for i in range(x + 1, N):
                if S[i] != T[i]:
                    tigauketa = i
                    break
            if tigauketa == N:
                prevans = "="
                print("=")
            elif S[tigauketa] > T[tigauketa]:
                prevnans = ">"
                print(">")
            else:
                prevans = "<"
                print("<")
        else:
            tigauketa = x
            if S > T:
                prevans = ">"
                print(">")
            elif S == T:
                prevnans = "="
                print("=")
            else:
                prevans = "<"
                print("<")
    else:
        print(prevans)
0