【SSL1382】車

Description 在n*n(n≤20)的方格棋盤上放置n個車(能夠攻擊所在行、列),有些格子不能放,求使它們不能互相攻擊的方案總數。html Input 第一行爲棋盤的大小n 第二行爲障礙的數量m 第三行到第m+3爲m個障礙ios Output 總數web Sample Input 4 2 1 1 2 2 Sample Output 14 思路:數組 咱們能夠設 f [ i ] [ j ]
相關文章
相關標籤/搜索