0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【競技プログラミング】AtCoder Beginner Contest 370_C問題

Posted at

問題

既存投稿一覧ページへのリンク

一覧ページ

解法イメージ

文字列SとTについて

  1. 下図の塗りつぶしがない、白色箇所は同じ文字列なので、変更する必要がない

base_image.create_20250413001711-ページ4.drawio.png

  1. 前の文字列(文字列S)が後の文字列(文字列T)より、辞書順で前になる文字と後ろになる文字を整理する

2.1 辞書順で前になる文字列は「後ろから置換」
(初期) adbeb
(01) afbb
(02) bfb
b

2.2 辞書順で後になる文字列は「前から置換」
(初期) adbeb
(01) afbcb

2.3 時間無視した整列
2.1と2.2を辞書順に整列し
afbeb
afbec <- この点をうまく整列させる方法を考える
bfbeb

これを基本の考え方として、前後が入り組んでいる場合は、前半と後半に分割して、効率的に置換して行くパターンね。
一旦、方針だけメモして後で考え足します。(25'04/13 00:00時点)

トヨタ開催の正答率がやたら低いし、個人的に相性悪いんだよなぁ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?