結果

問題 No.1439 Let's Compare!!!!
ユーザー first_vilfirst_vil
提出日時 2020-11-23 20:32:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 637 bytes
コンパイル時間 240 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 25,372 KB
最終ジャッジ日時 2024-04-19 19:51:51
合計ジャッジ時間 5,555 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 27 ms
10,752 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 AC 281 ms
14,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  import sys
  input=sys.stdin.readline
  from heapq import heappop,heappush,heapify
  
  n=int(input())
  s=list(input())
  t=list(input())
  
  diff=[]
  heapify(diff)
  for i in range(n):
    if s[i]!=t[i]:
      heappush(diff,-i)
  
  q=int(input())
  for _ in range(q):
    c,x,y=input().split()
    x=int(x)-1
    
    if c=='S':
      s[x]=y
    else:
      t[x]=y
    if s[x]!=t[x]:
      heappush(diff,-x)
      
    k=-1
    while diff:
      j=heappop(diff)
      if s[j]!=t[j]:
        k=j
        break
    if k==-1:
      print('=')
    else:
      print('>' if s[k]>t[k] else '<')
      heappush(diff,k)
main()
0