1010 - Knights in Chessboard PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB Given an m x n chessboard where you want to place chess knights. You have to find the number of maximum knights that can be placed in the chess…
题意,在一个n*n的棋盘上放置一些马,使这些马不能互相攻击,问最多能放多少. 思路:从第一行每隔一个放置一个马即可,注意n=1和n=2的情况要特判. #include<cstdio> int main(){ int n, m, t; scanf("%d", &t); for(int i = 1;i <= t;i ++){ scanf("%d%d", &n, &m); printf("Case %d: ",…