2019-12-03から1日間の記事一覧

next_partial_permutationとは何なのか?動作を観察した~ペアの全探索~

next_permutationの動きを確認 VI V; rep(i, 4){ V.push_back(i); } do{ debug(V); }while(next_permutation(ALL(V))); 出力 [V]: {0, 1, 2, 3} [V]: {0, 1, 3, 2} [V]: {0, 2, 1, 3} [V]: {0, 2, 3, 1} [V]: {0, 3, 1, 2} [V]: {0, 3, 2, 1} [V]: {1, 0, 2,…

sum of all cost between all nodes in a tree ~木の全点間コストの和~

Quiz https://yukicoder.me/problems/no/872 AC https://yukicoder.me/submissions/404193 解法 まずはganariyaさんの解説を読みましょう https://scrapbox.io/ganariya/YukicoderContest221_C%E5%95%8F%E9%A1%8CP2_%E3%80%8CAll_Tree_Path%E3%80%8D そこに…