You are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn you throw a perfect 6 si...
分类:
其他好文 时间:
2015-04-29 21:52:26
阅读次数:
177
Rimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a number N. And he calls thi...
分类:
其他好文 时间:
2015-04-29 21:48:46
阅读次数:
120
1038 - Race to 1 Again
PDF (English)
Statistics
Forum
Time Limit: 2 second(s)
Memory Limit: 32 MB
Rimi learned a new thing about integers, which is - any posi...
分类:
其他好文 时间:
2015-04-29 10:07:56
阅读次数:
129
1027 - A Dangerous Maze
PDF (English)
Statistics
Forum
Time Limit: 2 second(s)
Memory Limit: 32 MB
You are in a maze; seeing n doors in front of you in beginn...
分类:
其他好文 时间:
2015-04-28 14:16:03
阅读次数:
141
1030 - Discovering Gold
PDF (English)
Statistics
Forum
Time Limit: 2 second(s)
Memory Limit: 32 MB
You are in a cave, a long cave! The cave can be represented...
分类:
其他好文 时间:
2015-04-28 14:13:59
阅读次数:
139
Problem G
Probability|Given
Input: Standard Input
Output: Standard Output
N friends go to the local super market together. The probability of their buying something from the market is respectiv...
分类:
其他好文 时间:
2015-04-28 09:49:46
阅读次数:
145
1.题目描述:点击打开链接
2.解题思路:本题利用概率dp解决。根据题意描述,我们可以定义d(i,j)表示前i道题做对j道的概率。那么根据全概率公式,可以得到如下递推式:
d(i,j)=d(i-1,j)*(1-p[i])+d(i-1,j-1)*p[i](0≤j≤i)
其中p[i]表示第i道题做对的概率。这样,得到所有的d值后,ans=sum{d(i,j)|k≤j≤n}
3.代码:
#de...
分类:
其他好文 时间:
2015-04-25 13:48:27
阅读次数:
153
分析:
dis(k,v1,v2)函数求到当前位置概率为v1,到当前位置之前一步的概率为v2,前进k步到达位置的概率,然后矩阵加速。
代码:
//poj 3744
//sep9
#include
#include
using namespace std;
int pos[12];
double p,mat[4][4];
double ans[4][4];
void mul1()
{
d...
分类:
其他好文 时间:
2015-04-25 00:16:32
阅读次数:
140
Problem Description
You have a dice with m faces, each face contains a distinct number. We assume when we tossing the dice, each face will occur randomly and uniformly. Now you have T query to answer...
分类:
其他好文 时间:
2015-04-24 09:14:08
阅读次数:
131
Description
Alexander Charles McMillan loves to gamble, and during his last trip to the casino he ran across a new game. It is played on a linear sequence of squares as shown below.
A chip is...
分类:
其他好文 时间:
2015-04-23 23:30:27
阅读次数:
290