結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2021-03-26 21:48:50 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,202 bytes |
| コンパイル時間 | 146 ms |
| コンパイル使用メモリ | 82,496 KB |
| 実行使用メモリ | 113,140 KB |
| 最終ジャッジ日時 | 2024-11-29 08:42:31 |
| 合計ジャッジ時間 | 9,681 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 TLE * 1 |
ソースコード
N = int(input())
S = list(input())
T = list(input())
Q = int(input())
for i in range(N):
S[i]=int(S[i])
T[i]=int(T[i])
state = 0 # [0:=] [1:>] [2:<]
for i in range(N):
if S[i]<T[i]:
state = 2
break
if S[i]>T[i]:
state = 1
break
difi = i
for i in range(Q):
c,x,y=input().split()
x=int(x)
y=int(y)
if c=='T':
if T[x-1] == y:
if state==0:
print('=')
elif state==1:
print('>')
else:
print('<')
continue
else:
T[x-1] = y
else:
if S[x-1] == y:
if state==0:
print('=')
elif state==1:
print('>')
else:
print('<')
continue
else:
S[x-1] = y
if difi>=x-1:
for j in range(x-1,N):
if S[j]<T[j]:
state = 2
break
if S[j]>T[j]:
state = 1
break
else:
state=0
difi = j
if state==0:
print('=')
elif state==1:
print('>')
else:
print('<')
H20