結果
| 問題 | No.1439 Let's Compare!!!! |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-30 11:18:45 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 400 ms / 2,000 ms |
| コード長 | 621 bytes |
| 記録 | |
| コンパイル時間 | 174 ms |
| コンパイル使用メモリ | 85,120 KB |
| 実行使用メモリ | 128,000 KB |
| 最終ジャッジ日時 | 2026-05-25 21:31:02 |
| 合計ジャッジ時間 | 7,484 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
N = int(input())
S = list(map(int,list(input())))
T = list(map(int,list(input())))
from heapq import *
lis = []
for i in range(N):
if S[i]!=T[i]:
heappush(lis, i)
Q = int(input())
ans = ['=']*Q
for i in range(Q):
c,x,y = input().split()
x = int(x); y = int(y)
flag = S[x-1]==T[x-1]
if c=='S':
S[x-1] = y
else:
T[x-1] = y
if flag and S[x-1] != T[x-1]:
heappush(lis, x-1)
while len(lis):
ind = heappop(lis)
if S[ind]>T[ind]:
ans[i] = '>'
heappush(lis, ind)
break
elif S[ind]<T[ind]:
ans[i] = '<'
heappush(lis, ind)
break
print(*ans, sep='\n')