题目大意:有n条路可以选择,随机选择,选择了这条路时有一条规则,假如攻击力f大于了这条路的ci,那么可以从这条路逃出去,花费ti(有对应公式计算)
假如小于等于该值,则花费一天,并且攻击力增加ci,重复刚才的操作。问最终的期望是多少。
思路:
dp[i]表示的是攻击力为i的情况下,出去的期望。
根据期望的概念可以得
状态方程:dp[i]+=(1+dp[i+c[i])/n (当攻击力小于等...
分类:
其他好文 时间:
2015-02-02 16:04:19
阅读次数:
119
链接:click here
题意:对于一个包含n>0个元素的整数序列,如果序列中相邻元素之差的绝对值取边1到n-1的所有值,那么这个序列就叫做Jolly Jumper序列,
思路:水题模拟~~,不过注意*,因为不小心,wrong了几遍。
代码:
#include
#include
#include
#include
#include
#include
#include
u...
分类:
其他好文 时间:
2015-02-02 15:52:24
阅读次数:
131
分治的思想,比较水,但题很好
#include
#include
#include
using namespace std;
int t,n,m;
int vis[50010];
void v(int a,int b)
{
vis[a]=1;vis[b]=1;
vis[a+b]=1;vis[abs(a-b)]=1;
}
int rmax(int a,int b,int c...
分类:
其他好文 时间:
2015-02-02 00:44:30
阅读次数:
156
题意:给t组数据,每组数据一个字符串,对于每组数据先输出其字符串长度len,先将十进制的len转为二进制,取其后7位,前面有1剩余把1放在后七位的前面构成8位,按次序输出,输完len后,字符串转化为16进制输出。
关键在于读题。
#include
#include
#include
using namespace std;
char a[5000010];
int main()
{
i...
分类:
其他好文 时间:
2015-02-01 23:20:06
阅读次数:
222
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3261题意:一. 给定N个星球(0,...,N-1)及其对应的power(p0,...pn-1)二. 给定M条星球a与b间(a!=b)的通路三. 给出Q个指令,"destroy...
分类:
其他好文 时间:
2015-02-01 20:23:46
阅读次数:
203
//2970 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 bool shout(int num) 8 { 9 if(num%7==0)10 return true;11 else12 {13 wh...
分类:
其他好文 时间:
2015-02-01 09:32:30
阅读次数:
188
Description Your boss once had got many copies of a treasure map. Unfortunately, all the copies are now broken to many rectangular pieces, and what...
分类:
其他好文 时间:
2015-01-31 14:13:38
阅读次数:
154
题目连接:Click here
Arrange the Schedule
Time Limit: 1 Second
Memory Limit: 65536 KB
In Summer 2011, the ZJU-ICPC Team has a n-days training schedule. ZJU-ICPC Team has been divided into ...
分类:
其他好文 时间:
2015-01-31 13:05:07
阅读次数:
294
Challenge of WisdomTime Limit:2 Seconds Memory Limit:32768 KBBackground"Then, I want to know whether you're a wise boy!"Problem"I have a great deal of...
分类:
其他好文 时间:
2015-01-31 11:51:44
阅读次数:
529
#include
#include
#include
using namespace std;
int T;
int l,c;
double dp[2605][55][55];
bool b[2605][55][55];
double DP(int k,int x,int y){
if(x>=l&&y>=c)return 0;
if(b[k][x][y])return dp[k][...
分类:
其他好文 时间:
2015-01-30 19:43:26
阅读次数:
145