7K12 blog

猫でも分かる何か

2020-07-07から1日間の記事一覧

ABC150 C - Count Order

https://atcoder.jp/contests/abc150/submissions/14879069 std::next_permutationは辞書順に順列を列挙してくれる 「辞書順で」という問題設定になっているが、STLのnext_permutationは辞書順に順列を列挙してくれる。現在の順列が何番目かcount変数で管理…

ABC145 C - Average Length

https://atcoder.jp/contests/abc145/submissions/15054171 順列はstd::next_permutationが使える next_permutationに渡す数列はソート済みである必要がある 三平方の定理はstd::hypotが使える Nが8以下と非常に小さいので8!通り全列挙してもTLEしない。std:…