POJ
POJ 2441 : Arrange the Bulls 通ったんだけどこれでいいのかな。。 int N, M; int cows[30][30] = {}; int memo[(1 << 20) + 1] = {}; int solve(int i, int S) { if (memo[S] != -1) { return memo[S]; } if (i == N) return 1; int res = 0; for (int j =…
POJ 2441 : Arrange the Bulls 通ったんだけどこれでいいのかな。。 int N, M; int cows[30][30] = {}; int memo[(1 << 20) + 1] = {}; int solve(int i, int S) { if (memo[S] != -1) { return memo[S]; } if (i == N) return 1; int res = 0; for (int j =…