結果

問題 No.1439 Let's Compare!!!!
ユーザー gorugo30gorugo30
提出日時 2021-03-26 22:01:22
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,231 bytes
コンパイル時間 467 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 100,424 KB
最終ジャッジ日時 2023-08-19 15:19:26
合計ジャッジ時間 7,710 ms
ジャッジサーバーID
(参考情報)
judge14 / judge10
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,404 KB
testcase_01 AC 71 ms
71,348 KB
testcase_02 AC 72 ms
71,348 KB
testcase_03 AC 73 ms
71,272 KB
testcase_04 AC 72 ms
71,344 KB
testcase_05 AC 72 ms
71,368 KB
testcase_06 AC 72 ms
71,316 KB
testcase_07 AC 109 ms
77,784 KB
testcase_08 AC 121 ms
77,788 KB
testcase_09 AC 96 ms
76,756 KB
testcase_10 AC 258 ms
97,260 KB
testcase_11 AC 221 ms
98,700 KB
testcase_12 AC 223 ms
98,180 KB
testcase_13 AC 256 ms
97,344 KB
testcase_14 AC 247 ms
96,888 KB
testcase_15 AC 194 ms
96,696 KB
testcase_16 AC 203 ms
95,408 KB
testcase_17 AC 224 ms
95,712 KB
testcase_18 TLE -
権限があれば一括ダウンロードができます

ソースコード

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]:
                prevans = ">"
                print(">")
            else:
                prevans = "<"
                print("<")
        else:
            tigauketa = x
            if S[x] > T[x]:
                prevans = ">"
                print(">")
            elif S[x] == T[x]:
                prevans = "="
                print("=")
            else:
                prevans = "<"
                print("<")
    else:
        print(prevans)
0