摘要: 题目传送门:1049. Mondriaan思路: 找规律的一道水题。 假设长度为n的有f(n)种画法。容易求出f(0)=1,f(1)=2,f(2)=7... 找出递推式f(n)=3f(n-1)+f(n-2)-f(n-3)(推导了半节英语课。。。),打好表之后输入输出搞定。代码: 1 #include 2 using namespace std; 3 4 const int MAX=1000001; 5 int f[MAX]; 6 7 int main(){ 8 int testcases,l; 9 cin>>testcases;10 f[0]=1;11 ... 阅读全文
posted @ 2013-11-19 00:06 Jolin123 阅读(155) 评论(0) 推荐(0) 编辑