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_水色精進記録7_ABC119d

Posted at

Atcoder水色精進記録

ABC119
D - Lazy Faith
https://atcoder.jp/contests/abc119/tasks/abc119_d

アルゴリズム・データ構造

二分探索

考察

典型的な二分探索で解けそう。
神社についてxからの近傍を2分探索で求め左に行く場合、右に行く場合を考える
神社に行ったのち、最も近い寺にいった場合の最小値を計算
寺に行って神社にいったほうが移動距離が短い場合もあるので、S,Tを入れ替えて同じことを実施

提出

感想

水色diffだったが現在なら茶色くらい?

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?