Codeforces Round #370(div 2)
A B C :=w=
D:两个人得分互不影响很关键
一种是f[i][j]表示前i轮,分差为j的方案数
明显有f[i][j]=f[i-1][j-2k]+2*f[i-1][j-2k+1]+...+(2k+1)f[i-1][j]+...
枚举是K*T*T,转移是K 超时
不过发现转移的时候可以理解为j是j-1的算式的整个区间移动,于是可以维护f[i-1]的前缀和来达到O(1)的转移
另一种f[i][j]表示前i轮,某个人分数为j的方案数(两人互不影响,无先后手之分,所以两人等价)
式子写出来就少了第一种的前面的系数,还是要维护前缀和,更加清楚直接了
最后统计时候枚举第一个人的分数,累乘结果
E:???
Codeforces Round #370(div 2)的更多相关文章
- Codeforces Round #370 (Div. 2) E. Memory and Casinos (数学&&概率&&线段树)
题目链接: http://codeforces.com/contest/712/problem/E 题目大意: 一条直线上有n格,在第i格有pi的可能性向右走一格,1-pi的可能性向左走一格,有2中操 ...
- Codeforces Round #370 (Div. 2) E. Memory and Casinos 线段树
E. Memory and Casinos 题目连接: http://codeforces.com/contest/712/problem/E Description There are n casi ...
- Codeforces Round #370 (Div. 2)C. Memory and De-Evolution 贪心
地址:http://codeforces.com/problemset/problem/712/C 题目: C. Memory and De-Evolution time limit per test ...
- Codeforces Round #370 (Div. 2)B. Memory and Trident
地址:http://codeforces.com/problemset/problem/712/B 题目: B. Memory and Trident time limit per test 2 se ...
- Codeforces Round #370 (Div. 2) D. Memory and Scores 动态规划
D. Memory and Scores 题目连接: http://codeforces.com/contest/712/problem/D Description Memory and his fr ...
- Codeforces Round #370 (Div. 2) C. Memory and De-Evolution 水题
C. Memory and De-Evolution 题目连接: http://codeforces.com/contest/712/problem/C Description Memory is n ...
- Codeforces Round #370 (Div. 2) B. Memory and Trident 水题
B. Memory and Trident 题目连接: http://codeforces.com/contest/712/problem/B Description Memory is perfor ...
- Codeforces Round #370 (Div. 2) A. Memory and Crow 水题
A. Memory and Crow 题目连接: http://codeforces.com/contest/712/problem/A Description There are n integer ...
- Codeforces Round #370 (Div. 2)(简单逻辑,比较水)
C. Memory and De-Evolution time limit per test 2 seconds memory limit per test 256 megabytes input s ...
随机推荐
- FFMPEG ./configure 参数及意义
FFMPEG版本:2.6.2,编译环境:ubuntu 14.4. 不同版本的FFMPEG参数可能不同,可在FFMPEG目录下使用以下命令查看 ./configure --help --help pri ...
- Linux磁盘管理之磁盘结构、概念、原理01
一.磁盘的分类 磁盘主要有IDE.SATA.SCSI.IDE是比较老的硬盘,数据速度比较慢:SATA是现在用的比较多的,台式机.笔记本大多都用的SATA硬盘:SCSI硬盘速度最快,但是价格相对较高. ...
- Linux小技巧总结
1.fdisk创建磁盘分区不重启系统partprobe 使用fdisk工具只是将分区信息写到磁盘,如果需要mkfs磁盘分区则需要重启系统才能够读取到/dev/sda*,而使用partprobe则可以使 ...
- Android 中PopupWindow使用 (转)
参考学习后遇到问题: 要引用:有好几个,可以用错误提示解决: import android.widget.PopupWindow; import android.widget.Toast; Activ ...
- Debian deb源方法升级PHP软件包
学习Linxu以来,一直坚持编译方式安装软件包,貌似圈子里面也是都倾向于编译,可是搜索到的编译方法都是一堆复制粘贴来的指令, 每个人都这么编译, 却几乎没有人去写明那些五花八门的编译指令代表了什么,是 ...
- Linux aclocal
一.简介 二.安装 三.常用指令 1)安装m4 aclocal -I m4 2)查看aclocal的路径 aclocal --print-ac-dir 四.常见问题 1) LIBTOOL is und ...
- 天朝使用GAE入门指南
0. 引言 Across the Great Wall, we can reach every corner in the world. 洒家最近玩了几下 Google App Engine.由于众所 ...
- Ajax请求利用jsonp实现跨域
跨域: js有一个同源限制,简单说来源不一样的话就无法相互间交互.那么怎么算来源不一样呢, 举个例子:浏览器访问-->服务器A--->得到页面A---页面A中的js脚本只能访问服务器A的资 ...
- [To be translated] Nova:libvirt image 的生命周期
翻译自:http://www.pixelbeat.org/docs/openstack_libvirt_images/ The main stages of a Virtual Machine dis ...
- 关于Lucene 3.0升级到Lucene 4.x 备忘
最近,需要对项目进行lucene版本升级.而原来项目时基于lucene 3.0的,很古老的一个版本的了.在老版本中中,我们主要用了几个lucene的东西: 1.查询lucene多目录索引. 2.构建R ...