#include<stdio.h>
#include<iostream>
#include<cmath>
using namespace std;
const int N = 100;
int amount = 0;
int board[N][N];
void IncompleteChessBoard();
void Cover(int tr, int tc, int dr, int dc, int sizes);//tr子棋盘左上角方格所在行
//tc子棋盘左上角方格所在列
//dr残缺方格行
//dc残缺方格列
//sizes棋盘的行数或者列数
void OutputBoard(int board[][N], int sizes);
int main ()
{
IncompleteChessBoard();
}
void IncompleteChessBoard()
{
int k = 2;//假设棋盘有2^k*2^k个方格
int sizes = 1, x, y, i, j;
sizes = pow(2, k);//棋盘的边长
x = 1, y = 3;//假定(1,3)位残缺位
Cover(0, 0, x, y, sizes);
OutputBoard(board, sizes);
}
void Cover(int tr, int tc, int dr, int dc, int sizes)
{
int s, t;
if(sizes < 2)
[算法设计与分析]4.3.3二分法不相似情况(残缺棋盘)
最新推荐文章于 2024-03-12 22:47:54 发布