結果

問題 No.1439 Let's Compare!!!!
ユーザー mkawa2mkawa2
提出日時 2021-03-26 21:46:10
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 611 ms / 2,000 ms
コード長 1,219 bytes
コンパイル時間 253 ms
コンパイル使用メモリ 10,772 KB
実行使用メモリ 19,164 KB
最終ジャッジ日時 2023-08-19 15:14:19
合計ジャッジ時間 7,136 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
8,204 KB
testcase_01 AC 16 ms
8,272 KB
testcase_02 AC 16 ms
8,160 KB
testcase_03 AC 17 ms
8,156 KB
testcase_04 AC 18 ms
8,164 KB
testcase_05 AC 17 ms
8,196 KB
testcase_06 AC 16 ms
8,160 KB
testcase_07 AC 28 ms
8,664 KB
testcase_08 AC 35 ms
8,740 KB
testcase_09 AC 23 ms
8,552 KB
testcase_10 AC 606 ms
18,808 KB
testcase_11 AC 576 ms
14,800 KB
testcase_12 AC 587 ms
14,780 KB
testcase_13 AC 611 ms
19,164 KB
testcase_14 AC 591 ms
19,164 KB
testcase_15 AC 552 ms
12,532 KB
testcase_16 AC 557 ms
12,156 KB
testcase_17 AC 565 ms
11,924 KB
testcase_18 AC 548 ms
11,916 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

sys.setrecursionlimit(10**6)
int1 = lambda x: int(x)-1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.buffer.readline())
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def LI1(): return list(map(int1, sys.stdin.buffer.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
def BI(): return sys.stdin.buffer.readline().rstrip()
def SI(): return sys.stdin.buffer.readline().rstrip().decode()
# dij = [(0, 1), (-1, 0), (0, -1), (1, 0)]
dij = [(0, 1), (-1, 0), (0, -1), (1, 0), (1, 1), (1, -1), (-1, 1), (-1, -1)]
inf = 10**16
# md = 998244353
md = 10**9+7

from heapq import *

n=II()
st=[[c-48 for c in BI()],[c-48 for c in BI()]]
hp=[]
for i,(c0,c1) in enumerate(zip(st[0],st[1])):
    if c0!=c1:heappush(hp,i)

for _ in range(II()):
    i,j,a=SI().split()
    i=0 if i=="S" else 1
    j=int(j)-1
    a=int(a)
    if st[0][j]==st[1][j] and st[1-i][j]!=a:
        heappush(hp,j)
    st[i][j]=a
    while hp and st[0][hp[0]]==st[1][hp[0]]:
        heappop(hp)
    if hp:
        if st[0][hp[0]]<st[1][hp[0]]:print("<")
        else:print(">")
    else:
        print("=")
0