結果

問題 No.1439 Let's Compare!!!!
ユーザー NoaSaberNoaSaber
提出日時 2021-04-02 00:07:51
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,080 ms / 2,000 ms
コード長 665 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 134,068 KB
最終ジャッジ日時 2023-08-23 07:02:05
合計ジャッジ時間 12,059 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,380 KB
testcase_01 AC 72 ms
71,040 KB
testcase_02 AC 70 ms
70,864 KB
testcase_03 AC 72 ms
71,032 KB
testcase_04 AC 77 ms
71,032 KB
testcase_05 AC 72 ms
71,024 KB
testcase_06 AC 72 ms
71,196 KB
testcase_07 AC 204 ms
80,652 KB
testcase_08 AC 266 ms
81,516 KB
testcase_09 AC 174 ms
78,540 KB
testcase_10 AC 1,022 ms
133,464 KB
testcase_11 AC 1,063 ms
118,000 KB
testcase_12 AC 940 ms
114,928 KB
testcase_13 AC 1,029 ms
133,796 KB
testcase_14 AC 1,080 ms
134,068 KB
testcase_15 AC 1,032 ms
117,160 KB
testcase_16 AC 998 ms
112,480 KB
testcase_17 AC 900 ms
100,172 KB
testcase_18 AC 536 ms
95,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import heapq
N=int(input())
S=list(input())
T=list(input())
Q=int(input())
s,q=set(),[]
for i in range(N):
    if S[i]!=T[i]:
        q.append(i)
        s.add(i)
heapq.heapify(q)
for i in range(Q):
    c,x,y=input().split()
    x=int(x)-1
    if c=="T":
        T[x]=y
    else:
        S[x]=y
    if S[x]!=T[x]:
        heapq.heappush(q,x)
    while len(q)!=0:
        num=heapq.heappop(q)
        if int(S[num])>int(T[num]):
            print(">")
            heapq.heappush(q,num)
            break
        elif int(S[num])<int(T[num]):
            print("<")
            heapq.heappush(q,num)
            break
    if len(q)==0:
        print("=")
            
0