CF97C Winning Strategy
CF97C Winning Strategy
这题好玄学鸭。。。都不知道为啥是对的
设\(f[i][j]\)表示打了i轮比赛,有j个参加了一次的人,直接枚举有几个参加了转移过去即可
#include<bits/stdc++.h>
#define il inline
#define vd void
#define ll long long
il int gi(){
int x=0,f=1;char ch=getchar();
while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
return x*f;
}
double p[101];
double f[2][20001];
int main(){
int n=gi();double ans=0;
for(int i=0;i<=n;++i)scanf("%lf",&p[i]);
int now=0;
memset(f[now],-63,sizeof f[now]);
f[now][0]=0;
for(int i=0;i<=200;++i){
memset(f[now^1],-63,sizeof f[now^1]);
for(int j=0;j<=(i?20000:0);++j){
if(i)ans=std::max(ans,f[now][j]/i);
for(int k=0;k<=n;++k)
if(j+n-k-k>=0&&j+n-k-k<=20000){
f[now^1][j+n-k-k]=std::max(f[now^1][j+n-k-k],f[now][j]+p[k]);
}
}
now^=1;
}
printf("%.10lf\n",ans);
return 0;
}
CF97C Winning Strategy的更多相关文章
- CF97C Winning Strategy 构造、图论
题目传送门:http://codeforces.com/problemset/problem/97/C 题意:给出$n$与一个范围在$[0,1]$内的递增序列$P_0-P_n$,试构造一个无穷序列$\ ...
- 题解 CF97C 【Winning Strategy】
题解 CF97C [Winning Strategy] 此题是某平台%你赛原题,跟大家分享一下某校zsy和sxr等同学的神仙做法. 我解释一下题意,大是说,我有[无限]个人,每个人可以对他" ...
- mark一下咕掉的题目
蒟蒻才普及组呀~ 大佬别D我 等集中补一下 CF980F:咋说捏,我觉得要联赛了做这题有点浪费时间,等想颓废了再来写写叭qwq 215E/279D/288E/331C3/431D/433E/750G/ ...
- 【POJ1568】【极大极小搜索+alpha-beta剪枝】Find the Winning Move
Description 4x4 tic-tac-toe is played on a board with four rows (numbered 0 to 3 from top to bottom) ...
- poj1568 Find the Winning Move[极大极小搜索+alpha-beta剪枝]
Find the Winning Move Time Limit: 3000MS Memory Limit: 32768K Total Submissions: 1286 Accepted: ...
- codeforces 360 D - Remainders Game
D - Remainders Game Description Today Pari and Arya are playing a game called Remainders. Pari choos ...
- Codeforces 687B. Remainders Game[剩余]
B. Remainders Game time limit per test 1 second memory limit per test 256 megabytes input standard i ...
- Codeforces 549C. The Game Of Parity[博弈论]
C. The Game Of Parity time limit per test 1 second memory limit per test 256 megabytes input standar ...
- Bots(逆元,递推)
H. Bots time limit per test 1.5 seconds memory limit per test 256 megabytes input standard input out ...
随机推荐
- Mysqlbinlog工具及导出数据并转换编码导入
2014 - binlog是通过记录二进制文件方式来备份数据,然后在从二进制文件将数据恢复到某一时段或某一操作点. 1.使用mysqlbinlog工具来恢复 Mysqlbinlog日志如何开启? 在m ...
- windows 端口映射
netsh interface portproxy add v4tov4 listenport=8765 listenaddress=0.0.0.0 connectaddress=172.19.24. ...
- windows下PyCharm安装及使用
一.首先安装pycharm,可以参考这篇文章:http://www.jianshu.com/p/042324342bf4 1.win10_X64,其他Win版本也可以. 2.PyCharm版本:Pro ...
- VB ASP 使用 now() 时默认格式调整方法
修改注册表 [HKEY_USERS\.DEFAULT\Control Panel\International] "sShortDate"="yyyy-M-d" ...
- 【2017.12.05 智能驾驶/汽车电子】转载:如何成为一名无人驾驶工程师 By刘少山
之前对无人驾驶的理解就是通过刘少山老师的书:第一本无人驾驶技术书 通读之后,对智能驾驶有了一个初步的认识,如感知.决策.控制都涉及哪些领域,有哪些可以利用的技术: 但经过一段时间的实践,发现即使是在我 ...
- 心情烦闷annoying,贴几个图!唉!annoying
nothing could be more annoying!!!!! lost!failed!
- 3-urllib的post请求方式
在urllib 中,要进行post请求时,需传入相应的data值,这里通过http://www.iqianyue.com/mypost这个网站进行测试. 案例代码如下: #post 请求 import ...
- UserUI程序实现过程简述
1.__tmainCRTStartup 2. mainret = _tWinMain( (HINSTANCE)&__ImageBase, NULL, lpszCommandLine, Star ...
- PHP设计模式系列 - 装饰器
什么是装饰器 装饰器模式,对已有对象的部分内容或者功能进行调整,但是不需要修改原始对象结构,可以使用装饰器设 应用场景 设计一个UserInfo类,里面有UserInfo数组,用于存储用户名信息 通过 ...
- Spring MVC Interceptor
1 在spring-servlet.xml中进行如下配置 <mvc:interceptors> <mvc:interceptor> <mvc:mapping path=& ...