bzoj1925
2024-08-24 01:26:32
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 ;
}
最新文章
- [我给Unity官方视频教程做中文字幕]beginner Graphics – Lessons系列之摄像机介绍Cameras
- fir.im Weekly - iOS/Android 应用程序架构解析
- Entity Framework Code First (一)Conventions
- 使用jQuery要注意的问题
- Flex 远程加载crossdomain.xml 解决
- 第18章 使用MariaDB数据库管理系统
- POJ 1269 Intersecting Lines(直线相交判断,求交点)
- java.lang.Comparable接口
- css3多行省略号
- WordPress 3.5.1 crypt_private()远程拒绝服务漏洞(CVE-2013-2173)
- oracle的一知半解
- 21副GIF动图让你了解各种数学概念(转。太强大了)
- python打包exe pyinstaller 简单使用
- python datetime 与 time模块
- Tcl与Design Compiler (一)——前言
- RTMPdump 使用说明
- The algorithm learning of sort which include Bubblesort,Insertsort,Quicksort and Mergesort.
- 在UnrealEngine中用Custom节点实现马赛克效果
- [pytorch修改]npyio.py 实现在标签中使用两种delimiter分割文件的行
- vue组件库(四):组件功能模块划分
热门文章
- 转:c++ 11 新特性
- go语言学习之路 一:开发环境配置
- 79.iOS 设备的UI规范和iOS各控件默认高度
- weexapp 开发流程(一)开发环境配置
- opencms 安装出现以下的问题:Your &;#39;max_allowed_packet&;#39; variable is set to less than 16777216 Byte (16MB).
- Effective C++ 条款17 以独立语句将newed对象置入智能指针
- MVC5中Model层开发数据注解 EF Code First Migrations数据库迁移 C# 常用对象的的修饰符 C# 静态构造函数 MSSQL2005数据库自动备份问题(到同一个局域网上的另一台电脑上) MVC 的HTTP请求
- 使用 Docker 在 Linux 上托管 ASP.NET Core 应用程序
- php使用魔法函数和不使用魔法函数比较
- Robotium结果的收集和失败重跑