結果

問題 No.1439 Let's Compare!!!!
ユーザー marroncastlemarroncastle
提出日時 2021-03-30 11:18:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 612 ms / 2,000 ms
コード長 621 bytes
コンパイル時間 469 ms
コンパイル使用メモリ 87,224 KB
実行使用メモリ 116,988 KB
最終ジャッジ日時 2023-08-20 07:38:46
合計ジャッジ時間 9,926 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,652 KB
testcase_01 AC 77 ms
71,328 KB
testcase_02 AC 76 ms
71,428 KB
testcase_03 AC 77 ms
71,484 KB
testcase_04 AC 77 ms
71,096 KB
testcase_05 AC 77 ms
71,328 KB
testcase_06 AC 75 ms
71,552 KB
testcase_07 AC 157 ms
78,368 KB
testcase_08 AC 196 ms
79,364 KB
testcase_09 AC 143 ms
78,528 KB
testcase_10 AC 515 ms
116,708 KB
testcase_11 AC 612 ms
108,320 KB
testcase_12 AC 545 ms
106,380 KB
testcase_13 AC 531 ms
116,888 KB
testcase_14 AC 522 ms
116,988 KB
testcase_15 AC 574 ms
105,064 KB
testcase_16 AC 535 ms
106,332 KB
testcase_17 AC 516 ms
105,944 KB
testcase_18 AC 269 ms
105,176 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
S = list(map(int,list(input())))
T = list(map(int,list(input())))
from heapq import *
lis = []
for i in range(N):
  if S[i]!=T[i]:
    heappush(lis, i)
Q = int(input())
ans = ['=']*Q
for i in range(Q):
  c,x,y = input().split()
  x = int(x); y = int(y)
  flag = S[x-1]==T[x-1]
  if c=='S':
    S[x-1] = y
  else:
    T[x-1] = y
  if flag and S[x-1] != T[x-1]:
    heappush(lis, x-1)
  while len(lis):
    ind = heappop(lis)
    if S[ind]>T[ind]:
      ans[i] = '>'
      heappush(lis, ind)
      break
    elif S[ind]<T[ind]:
      ans[i] = '<'
      heappush(lis, ind)
      break
print(*ans, sep='\n')
0