![](https://s.togetter.com/static/web/img/placeholder.gif)
AtCoder Beginner Contest 073
AtCoder Beginner Contest 073 - AtCoder Beginner Contest 073 | AtCoder:
http://abc073.contest.atcoder.jp
-
masashinakata
- 1728
- 0
- 0
- 0
![](https://s.togetter.com/static/web/img/placeholder.gif)
なるほど、みんなワーシャルフロイドやってるからnext_permutationのソートが話題に出るのか(自分も途中で(iではなく)r[i]を入れかけてそのときに思い当たらなかったので危なかった)。
2017-09-09 22:52:04![](https://s.togetter.com/static/web/img/placeholder.gif)
n! 回らなくて辞書順最小でループが終わる仕様は嵌りやすいところではあるけど {0, 0, 0, 1, 1, 1} で nC3 を列挙できたりして便利
2017-09-09 22:54:52![](https://s.togetter.com/static/web/img/placeholder.gif)
next_permutationは与えた順列を次の順列で置き換えて,次の順列が存在しない(降順に並んでいる)ときにfalseを返すので,はじめ昇順ソートされていないと全探索にならないですね
2017-09-09 22:55:59![](https://s.togetter.com/static/web/img/placeholder.gif)
A: Console.WriteLine(N.ToString().Contains('9') ? "Yes" : "No"); B: Console.WriteLine(L.Zip(R,(l,r) => r - l + 1).Sum());
2017-09-09 22:56:20![](https://s.togetter.com/static/web/img/placeholder.gif)
CはDictionary<int,int> dicに Aの値の出現個数を入れておいて Console.WriteLine(dic.Select(kvp => kvp.Value%2).Sum());
2017-09-09 22:57:49![](https://s.togetter.com/static/web/img/placeholder.gif)
int v[n]; void dfs(p) { if (p == n) { calc(); return; } for (i; p..n) { swap(v[p], v[i]); dfs(p+1); swap(v[p], v[i]); } }
2017-09-09 23:12:19