結果

問題 No.1439 Let's Compare!!!!
ユーザー O2MTO2MT
提出日時 2021-03-27 16:07:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 630 bytes
コンパイル時間 732 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 110,456 KB
最終ジャッジ日時 2024-05-06 21:57:32
合計ジャッジ時間 4,673 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
58,240 KB
testcase_01 AC 36 ms
52,608 KB
testcase_02 AC 36 ms
52,352 KB
testcase_03 WA -
testcase_04 AC 39 ms
53,760 KB
testcase_05 AC 38 ms
52,992 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 TLE -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from heapq import *
N = int(input())
S = list(str(input()))
T = list(str(input()))
Q = int(input())
A = []
for i in range(N):
    if S[i] != T[i]:
        heappush(A,i)

for _ in range(Q):
    c,x,y = map(str,input().split())
    x = int(x)-1
    if c == 'T':
        T[x] = y
    else:
        S[x] = y
    if S[x] != T[x]:
        if x not in A:
            heappush(A,x)
    else:
        if x in A:
            A.remove(x)
    if A == []:
        print('=')
        continue
    
    a = heappop(A)
    heappush(A,a)

    if S[a] > T[a]:
        print('>')
    elif S[a] < T[a]:
        print('<')
    else:
        print('=')
0