Home
About
Corporate Site
About
binary_search
C++
algorithm
binary_search
2021年6月16日
二分探索の応用
皆さんご存知の二分探索。この応用について今回は書いていきたいと思う。 二分探索の一般化 二分探索とはつまり、範囲を特定することである。 例億マス計算 そこで今回は二分探索を使う下記問題を解いていく C - 億マス計算AtCoder is a programming contest site for anyone from beginners to experts. We hold weekly programming contests online.AtCoderAtCoder Inc. [https://atcoder.jp/contests/arc037/tasks/arc037_c] 愚直に2重ループで解くと O(N²)になるため、時間が足りなくなる blog-binary_search_2blog-binary_search_2. GitHub Gist: instantly share code, notes, and snippets.Gist262588213843476 [https://gist.github.com/kooooohe/8cc33e0f1e