結果

問題 No.1439 Let's Compare!!!!
ユーザー first_vilfirst_vil
提出日時 2020-11-23 23:06:09
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 919 ms / 2,000 ms
コード長 595 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 86,920 KB
実行使用メモリ 117,660 KB
最終ジャッジ日時 2023-08-19 15:05:34
合計ジャッジ時間 10,002 ms
ジャッジサーバーID
(参考情報)
judge10 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,208 KB
testcase_01 AC 65 ms
71,156 KB
testcase_02 AC 64 ms
71,232 KB
testcase_03 AC 64 ms
70,960 KB
testcase_04 AC 69 ms
71,184 KB
testcase_05 AC 68 ms
71,064 KB
testcase_06 AC 67 ms
71,516 KB
testcase_07 AC 170 ms
80,196 KB
testcase_08 AC 196 ms
79,868 KB
testcase_09 AC 149 ms
78,436 KB
testcase_10 AC 862 ms
109,932 KB
testcase_11 AC 908 ms
116,956 KB
testcase_12 AC 856 ms
114,468 KB
testcase_13 AC 830 ms
109,588 KB
testcase_14 AC 914 ms
111,880 KB
testcase_15 AC 919 ms
117,660 KB
testcase_16 AC 862 ms
112,616 KB
testcase_17 AC 784 ms
100,156 KB
testcase_18 AC 471 ms
95,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  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