結果

問題 No.1439 Let's Compare!!!!
ユーザー wolgnikwolgnik
提出日時 2021-03-26 21:56:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 325 ms / 2,000 ms
コード長 573 bytes
コンパイル時間 1,784 ms
コンパイル使用メモリ 87,248 KB
実行使用メモリ 117,068 KB
最終ジャッジ日時 2023-08-19 15:18:30
合計ジャッジ時間 7,140 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 65 ms
71,452 KB
testcase_01 AC 65 ms
71,420 KB
testcase_02 AC 66 ms
71,344 KB
testcase_03 AC 69 ms
71,420 KB
testcase_04 AC 66 ms
71,320 KB
testcase_05 AC 70 ms
71,548 KB
testcase_06 AC 63 ms
71,532 KB
testcase_07 AC 142 ms
78,156 KB
testcase_08 AC 149 ms
78,976 KB
testcase_09 AC 111 ms
77,912 KB
testcase_10 AC 321 ms
116,764 KB
testcase_11 AC 268 ms
104,820 KB
testcase_12 AC 245 ms
104,488 KB
testcase_13 AC 325 ms
116,776 KB
testcase_14 AC 317 ms
117,068 KB
testcase_15 AC 274 ms
104,456 KB
testcase_16 AC 311 ms
104,652 KB
testcase_17 AC 302 ms
105,080 KB
testcase_18 AC 177 ms
103,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import heapq
hpush = heapq.heappush
hpop = heapq.heappop
input = sys.stdin.readline
N = int(input())
S = list(map(int, list(input())[: -1]))
T = list(map(int, list(input())[: -1]))

h = []
for i in range(N):
  if S[i] != T[i]: hpush(h, i)

for _ in range(int(input())):
  c, x, y = input().split()
  x = int(x) - 1
  y = int(y)
  if c == "S": S[x] = y
  if c == "T": T[x] = y
  if S[x] != T[x]: hpush(h, x)

  while len(h) and S[h[0]] == T[h[0]]: hpop(h)

  if len(h):
    i = h[0]
    if S[i] > T[i]: print(">")
    if S[i] < T[i]: print("<")
  else: print("=")
0