2009-07-04から1日間の記事一覧
与えられた文字列の隣同士が異なる場合が何個あるか数えろという問題。 順列組み合わせを自分で書こうとして手間だったけど、早々にあきらめてSTLのAlgorithmを使用すると一瞬で解決。 next_permutationが便利すぎるんじゃ。 #include <string> #include <algorithm> using name</algorithm></string>…
与えられた文字列の隣同士が異なる場合が何個あるか数えろという問題。 順列組み合わせを自分で書こうとして手間だったけど、早々にあきらめてSTLのAlgorithmを使用すると一瞬で解決。 next_permutationが便利すぎるんじゃ。 #include <string> #include <algorithm> using name</algorithm></string>…