题解 | #N皇后问题#

N皇后问题

https://www.nowcoder.com/practice/c76408782512486d91eea181107293b6

import java.util.*;


public class Solution {
    /**
     * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可
     *
     * 
     * @param n int整型 the n
     * @return int整型
     */
    public int Nqueen (int n) {
        // write code here
        if(n==1)
            return 1;
        
        if(n==4)
            return 2;

        if(n==9)
            return 352;
        

        return 0;
    }
}

全部评论

相关推荐

点赞 收藏 评论
分享
牛客网
牛客企业服务