matsueushi

AtCoder ABC 064 D - Insertion

競プロ    AtCoder
2022-5-31 22:18

https://atcoder.jp/contests/abc064/tasks/abc064_d

先頭に"(", 末尾に")“を繋げて括弧列を作るのが辞書式最小となる。 (そのような作り方をしないと、より左の位置に”)“が出現する)

“(” -> +1, “)” -> -1 と文字列を置き換えて累積和を取ったものを c[i] とすると、 c[i] ≥ 0 (1≤i≤n-1), c[n] = 0 が括弧列を成立させる条件である。

https://atcoder.jp/contests/abc064/submissions/32131694

  • Home
  • Blog
  • BOaT
  • NATSUMEN
  • Playlist
  • Other
  • AtCoder
  • Categories
  • Tags
  • Search
  • About
Copyright © 2019–2025
Built with Hugo and theme Tokiwa. 164 words in this page.

AtCoder ABC 133 D - Rain Flows into Dams AtCoder ABC 134 D - Preparing Boxes
Related AtCoder ABC 133 D - Rain Flows into Dams  /  AtCoder ABC 094 C - Many Medians  /  AtCoder ABC 183 E - Queen on Grid  /  AtCoder ABC 130 C - Rectangle Cutting  /  AtCoder DISCO presents ディスカバリーチャンネル コードコンテスト2020 予選 C - Strawberry Cakes  /  AtCoder ABC 137 D - Summer Vacation  /  AtCoder ABC 117 C - Streamline  /  AtCoder みんなのプロコン2019 C - When I hit my pocket...  /  AtCoder ABC 154 E - Almost Everywhere Zero  /  AtCoder ABC 135 C - City Savers  /  AtCoderで緑色になった  /  AtCoder ABC 250 E - Prefix Equality  /  JuliaでAtCoderに挑戦  /  AtCoderメモ書き

comments powered by Disqus