dp

搬题解~~:http://blog.csdn.net/aarongzk/article/details/44871391

#include<cstdio>
using namespace std;
const int N = ;
int n, p, pre;
int f[][N];
int main()
{
scanf("%d%d", &n, &p);
f[pre][] = ;
for(int i = ; i <= n; ++i)
{
pre ^= ;
for(int j = ; j <= n; ++j) f[pre][j] = (f[pre][j - ] + f[pre ^ ][i - j]) % p;
}
if(n == ) puts("");
else printf("%d\n", (f[pre][n] << ) % p);
return ;
}

最新文章

  1. [我给Unity官方视频教程做中文字幕]beginner Graphics – Lessons系列之摄像机介绍Cameras
  2. fir.im Weekly - iOS/Android 应用程序架构解析
  3. Entity Framework Code First (一)Conventions
  4. 使用jQuery要注意的问题
  5. Flex 远程加载crossdomain.xml 解决
  6. 第18章 使用MariaDB数据库管理系统
  7. POJ 1269 Intersecting Lines(直线相交判断,求交点)
  8. java.lang.Comparable接口
  9. css3多行省略号
  10. WordPress 3.5.1 crypt_private()远程拒绝服务漏洞(CVE-2013-2173)
  11. oracle的一知半解
  12. 21副GIF动图让你了解各种数学概念(转。太强大了)
  13. python打包exe pyinstaller 简单使用
  14. python datetime 与 time模块
  15. Tcl与Design Compiler (一)——前言
  16. RTMPdump 使用说明
  17. The algorithm learning of sort which include Bubblesort,Insertsort,Quicksort and Mergesort.
  18. 在UnrealEngine中用Custom节点实现马赛克效果
  19. [pytorch修改]npyio.py 实现在标签中使用两种delimiter分割文件的行
  20. vue组件库(四):组件功能模块划分

热门文章

  1. 转:c++ 11 新特性
  2. go语言学习之路 一:开发环境配置
  3. 79.iOS 设备的UI规范和iOS各控件默认高度
  4. weexapp 开发流程(一)开发环境配置
  5. opencms 安装出现以下的问题:Your &amp;#39;max_allowed_packet&amp;#39; variable is set to less than 16777216 Byte (16MB).
  6. Effective C++ 条款17 以独立语句将newed对象置入智能指针
  7. MVC5中Model层开发数据注解 EF Code First Migrations数据库迁移 C# 常用对象的的修饰符 C# 静态构造函数 MSSQL2005数据库自动备份问题(到同一个局域网上的另一台电脑上) MVC 的HTTP请求
  8. 使用 Docker 在 Linux 上托管 ASP.NET Core 应用程序
  9. php使用魔法函数和不使用魔法函数比较
  10. Robotium结果的收集和失败重跑