結果
| 問題 |
No.1439 Let's Compare!!!!
|
| コンテスト | |
| ユーザー |
FromBooska
|
| 提出日時 | 2023-03-17 19:09:26 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 1,368 bytes |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 82,164 KB |
| 実行使用メモリ | 113,424 KB |
| 最終ジャッジ日時 | 2024-09-18 10:07:56 |
| 合計ジャッジ時間 | 6,801 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 TLE * 1 |
ソースコード
# def main():にしよう
# まずNはintで受けるのか、文字列で受けるのか
# 長さ10**5はintには巨大すぎる
# 数字が大きすぎるか
# どの桁まで同じかを管理するのでどうだろう
from sys import stdin
readline = stdin.readline
def check(LIST1, LIST2, start, N):
idx = start-1
for i in range(start, N):
if int(LIST1[i]) == int(LIST2[i]):
idx = i
elif int(LIST1[i]) > int(LIST2[i]):
return idx, '>'
elif int(LIST1[i]) < int(LIST2[i]):
return idx, '<'
return N-1, '='
def main():
N = int(readline())
S_list = list(readline()[:-1]) #最後は改行
T_list = list(readline()[:-1]) #最後は改行
same, ans = check(S_list, T_list, 0, N)
Q = int(readline())
for i in range(Q):
query = list(map(str, readline().split()))
d = int(query[1])-1
new = int(query[2])
if d <= same+1:
if query[0] == 'S':
S_list[d] = new
elif query[0] == 'T':
T_list[d] = new
same, ans = check(S_list, T_list, d, N)
print(ans)
elif d > same+1:
if query[0] == 'S':
S_list[d] = new
elif query[0] == 'T':
T_list[d] = new
print(ans)
if __name__ == '__main__':
main()
FromBooska