水题,一个小模拟,规律也好找
f3 = f1 * 2 + f2;
#include
#include
#include
#include
#include
const int INF = 1e8;
const int N = 100;
#define ll long long
using namespace std;
int a[251][N];
int b[N] = {0};
in...
分类:
其他好文 时间:
2014-06-18 07:28:29
阅读次数:
190
TilingDescriptionIn how many ways can you tile
a 2xn rectangle by 2x1 or 2x2 tiles?Here is a sample tiling of a 2x17
rectangle.InputInput is a sequenc...
分类:
其他好文 时间:
2014-06-02 00:08:55
阅读次数:
343
题目大意:给你一个2*N的矩形。
让你用2*1或者2*2的小矩形去拼成2*N的矩形。问你有多少种拼法。解题思路:类似于简单的骨牌铺路。N长度的矩形,可以由
前(N-1)种+最后一个放竖着的2*1小矩形 和 前(N-2)种+最后两位横着放两位2*1的小矩形 和 前(N-2)种+最后两位放一个两位2*2...
分类:
其他好文 时间:
2014-05-25 23:26:40
阅读次数:
386
题目链接:uva 11270 - Tiling Dominoes
题目大意:用1?2木块将给出的n?m大小的矩阵填满的方法总数。
解题思路:插头dp的裸题,dp[i][s]表示第i块位置,并且该位置对应的行数的状态为s的时候的总情况数。0表示为竖放预留留的位置,1表示填上的位置,不管是竖放还是横放。并且第一位状态用滚动数组优化空间。
#include
#include
#incl...
分类:
其他好文 时间:
2014-05-23 07:39:17
阅读次数:
194
1.采集去除链接[Copy to
clipboard]CODE:{dede:trim}]*)>([^]*)>([^{/dede:trim}这样做会去掉与之间的字符!这样整个文章就少了部分字符,不完整了!后来我多次测试,总算找到了正确的使用方法!如下:{dede:trim}]*)>{/dede:tri...
分类:
其他好文 时间:
2014-05-23 07:07:02
阅读次数:
231
题目连接:Codeforces 432E Square Tiling
题目大意:给出一个n?m的矩阵,要求对该矩阵进行上色,用大写字母,但是每次上色的区域必须是正方形,不求相邻的上色区域不能有相同的颜色,求字典序最小的方案(字典序比较,从左至右,从上到下)
解题思路:用贪心的思想去构造矩阵,因为字典序的优先级为左至右,以及上到下,所以我们每次对于一个未上色点x,y,考虑最少要放到的长度...
分类:
其他好文 时间:
2014-05-22 07:53:17
阅读次数:
280
题目链接:11270 - Tiling Dominoes
和POJ 2411一样的题目,试着用插头DP写了下
代码:
#include
#include
#include
using namespace std;
int n, m, pre = 0, now = 1;
long long dp[2][2222];
int main() {
while (~scanf("%d%d",...
分类:
其他好文 时间:
2014-05-18 14:44:37
阅读次数:
264
insert 触发器示例create trigger tri_inserton studentfor
insertasdeclare @student_id char(10)select @student_id=s.student_id fromstudent
s inner join insert...
分类:
其他好文 时间:
2014-05-09 19:43:53
阅读次数:
296
出现上述错误的原因有以下几种:1) unused
pin没有设置,可能会收到外部信号的干扰;设置未用引脚为As input tri-stated with weak
pull-up.2) 系统时钟信号没有约束,或者SDRAM等存储设备的时钟没有配置正确;3) 系统复位信号没有连接外部复位开关;4) ...
分类:
其他好文 时间:
2014-05-05 09:42:07
阅读次数:
704
一、采用tri::function/bind方法实现类成员函数内部调用首先声明函数类型1
std::tr1::function func;在需要调用函数的地方绑定函数 1 switch (flgFun) { 2 case flgSine: 3
func = std::tr1::bind(&C...
分类:
其他好文 时间:
2014-05-01 05:03:39
阅读次数:
346