結果

問題 No.1439 Let's Compare!!!!
コンテスト
ユーザー NatsubiSogan
提出日時 2021-04-03 23:49:50
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 778 ms / 2,000 ms
コード長 556 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 199 ms
コンパイル使用メモリ 85,504 KB
実行使用メモリ 119,148 KB
最終ジャッジ日時 2026-05-25 21:33:35
合計ジャッジ時間 9,508 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from heapq import *
from re import split
n = int(input())
s, t = list(input()), list(input())
l = []
heapify(l)
for i in range(n):
    if s[i] != t[i]:
        heappush(l, i)
for _ in range(int(input())):
    c, x, y = input().split()
    x = int(x)
    if c == "S":
        s[x - 1] = y
    else:
        t[x - 1] = y
    if s[x - 1] != t[x - 1]:
        heappush(l, x - 1)
    while l:
        p = heappop(l)
        if s[p] != t[p]:
            print(">" if s[p] > t[p] else "<")
            heappush(l, p)
            break
    else:
        print("=")
0