intさわだんのBlack History

刹那的レジェンドになりたい。

全列挙

POJ3187 Backward Digit Sums

全列挙。next_permutationを使うとらく。やるだけです。ちょっと数学力が足りないのでせこい技を使ってしまった。 #include <cstdio> #include <algorithm> #include <iostream> using namespace std; int main(){ int n,sum; int d[12]; int c[12][12] = {0}; c[0][0] = 1; c[1][0] = 1; </iostream></algorithm></cstdio>…