結果

問題 No.1439 Let's Compare!!!!
ユーザー first_vilfirst_vil
提出日時 2020-11-23 23:05:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 588 ms / 2,000 ms
コード長 635 bytes
コンパイル時間 1,576 ms
コンパイル使用メモリ 87,096 KB
実行使用メモリ 120,520 KB
最終ジャッジ日時 2023-08-19 15:05:18
合計ジャッジ時間 7,815 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,232 KB
testcase_01 AC 70 ms
71,264 KB
testcase_02 AC 68 ms
71,228 KB
testcase_03 AC 68 ms
71,240 KB
testcase_04 AC 66 ms
71,288 KB
testcase_05 AC 69 ms
71,008 KB
testcase_06 AC 67 ms
71,352 KB
testcase_07 AC 148 ms
79,488 KB
testcase_08 AC 197 ms
80,560 KB
testcase_09 AC 131 ms
78,312 KB
testcase_10 AC 508 ms
112,748 KB
testcase_11 AC 588 ms
120,520 KB
testcase_12 AC 493 ms
116,628 KB
testcase_13 AC 507 ms
113,288 KB
testcase_14 AC 511 ms
114,840 KB
testcase_15 AC 526 ms
118,700 KB
testcase_16 AC 515 ms
114,872 KB
testcase_17 AC 459 ms
103,108 KB
testcase_18 AC 158 ms
95,464 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