int clockPath(int n) { if (n & 1) return 0; int dp[n+1][12]; dp[0][0] = 1; for (int j = 1; j < 12; j ++ ) dp[0][j] = 0; for (int i = 1; i <= n; i ++ ) { for (int j = 0; j < 12; j ++ ) dp[i][j] = dp[i-1][(j==0?11:j-1)] + dp[i-1][(j==11?0:j+1)]; } return dp[n][0]; }这个是比较直接的动态规划解法,空间复杂度较大