
递归与分治
CCSUZB
吾生也有涯,而知也无涯
展开
-
棋盘覆盖问题
#include <iostream> #include <algorithm> using namespace std;int num = 1; int chess[100][100];void FindChess(int tr, int tc, int dr, int dc, int size) { if (size == 1) return; int t=num原创 2017-06-24 21:30:53 · 341 阅读 · 0 评论 -
循环日程表问题
#include <iostream> #include <algorithm> using namespace std; int Play[50][50];void solve(int row, int col, int size) { if (size == 1) return; int half = size / 2; Play[row + half][原创 2017-06-25 19:34:25 · 343 阅读 · 0 评论 -
Uva12627
题目链接一道需要推导的递归 可以这么想,用前B行的红色气球的数量减去A-1行的红色球的数量就可以得到第A行到第B行的红色气球的数量。 公式如下f(k,i)为当k小时时前i行的红气球书 pre[k]时k小时时红气球总数 #include <iostream> #include <cstdio> using namespace std;const int maxn = 40; int t, k,原创 2017-07-05 15:52:02 · 357 阅读 · 0 评论