tjut 4301
来源:互联网 发布:腾达路由器软件升级 编辑:程序博客网 时间:2024/06/08 14:24
#include<iostream> #include<cstdio> using namespace std; int dp[1005][2005][3]={0}; int main() { int n,x,y; dp[1][1][1]=1;dp[1][2][0]=1; for(int i=2;i<=1002;i++){ for(int j=1;j<=i*2;j++){ dp[i][j][1]=(2*dp[i-1][j][0]+dp[i-1][j][1]+dp[i-1][j-1][0]+dp[i-1][j-1][1])%100000007; dp[i][j][0]=(dp[i-1][j][0]+2*dp[i-1][j-1][1]+2*dp[i-1][j-1][0]+dp[i-1][j-2][0]+dp[i-1][j-2][1])%100000007; } } scanf("%d",&n); while(n--){ scanf("%d%d",&x,&y); printf("%d\n",(dp[x][y][1]+dp[x][y][0])%100000007); } return 0; }
0 0
- tjut 4301
- tjut 5289
- tjut 5288
- tjut 5294
- tjut 2586
- tjut 5296
- tjut 5297
- tjut 5299
- tjut 5384
- tjut 5387
- tjut 5386
- tjut 5381
- tjut 5400
- tjut 5399
- tjut 5396
- tjut 5398
- tjut 5412
- tjut 5410
- Java 内存溢出(java.lang.OutOfMemoryError)的常见情况和处理方式总结
- 设计模式之桥接模式(Bridge)
- thinking in java test3.4练习(2)(3)别名机制
- jQuery源码分析笔记-构造jQuery对象(三)
- Win7中64位有关于“应用程序无法正常启动0xc000007b”的问题解决
- tjut 4301
- Oracle游标
- 数值的整数次方
- ISO8583报文(一)
- HDU 5776 sum(抽屉原理)
- cf 619c 科学记数法1
- 大数据开发基础(上)学习笔记
- MySQL使用like出现 操作MySQL数据库报出:Parameter index out of range (1 > number of parameters
- 【1】文本挖掘的主要概念