結果

問題 No.1439 Let's Compare!!!!
ユーザー c-yanc-yan
提出日時 2021-03-26 22:15:16
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 647 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 10,896 KB
実行使用メモリ 19,472 KB
最終ジャッジ日時 2023-08-19 15:21:56
合計ジャッジ時間 7,131 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
19,472 KB
testcase_01 AC 14 ms
7,692 KB
testcase_02 AC 13 ms
7,872 KB
testcase_03 AC 13 ms
7,740 KB
testcase_04 AC 14 ms
7,748 KB
testcase_05 AC 13 ms
7,696 KB
testcase_06 AC 13 ms
7,880 KB
testcase_07 AC 19 ms
8,412 KB
testcase_08 AC 22 ms
8,504 KB
testcase_09 AC 15 ms
8,152 KB
testcase_10 AC 300 ms
17,644 KB
testcase_11 AC 317 ms
17,632 KB
testcase_12 AC 318 ms
17,380 KB
testcase_13 AC 316 ms
17,656 KB
testcase_14 AC 299 ms
17,680 KB
testcase_15 AC 347 ms
17,736 KB
testcase_16 AC 325 ms
17,688 KB
testcase_17 AC 344 ms
17,716 KB
testcase_18 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin

readline = stdin.readline

N = int(readline())
S = list(readline()[:-1])
T = list(readline()[:-1])
Q = int(readline())

p = 0
while p < N and S[p] == T[p]:
    p += 1

result = []
for _ in range(Q):
    c, x, y = readline().split()
    x = int(x) - 1
    if  c == 'S':
        S[x] = y
    elif c == 'T':
        T[x] = y
    if x < p and S[x] != T[x]:
        p = x
    elif x == p and S[x] == T[x]:
        while p < N and S[p] == T[p]:
            p += 1

    if p == N:
        result.append('=')
    elif S[p] > T[p]:
        result.append('>')
    elif S[p] < T[p]:
        result.append('<')
print(*result, sep='\n')
0