http://acm.hdu.edu.cn/showproblem.php?pid=5012Problem Description There are 2 special dices on the table. On each face of the dice, a distinct number ...
分类:
其他好文 时间:
2014-09-14 20:35:37
阅读次数:
269
写错了,坑了自己好久,直接广搜可能更好,我害怕超时,记忆化搜索了一下 ,写的时候小地方写错了,
int dp[7][7][7][7][7][7];
int su,sd,sl,sr,sf,sb;
int eu,ed,el,er,ef,eb;
void init() {
memset(dp,-1,sizeof(dp));
}
bool input() {
while(ci...
分类:
其他好文 时间:
2014-09-14 18:02:37
阅读次数:
266
http://acm.hdu.edu.cn/showproblem.php?pid=4652
掷一枚骰子,有m个面,问掷出连续出现n个相同的面以及连续出现n个两两不同的面的期望。
设dp[i]表示已经掷出i个相同/不同的面的期望,可以确定终态dp[n] = 0,
对于出现连续n个相同的面有
dp[i] = 1/m * dp[i+1] + (m-1)/m*dp[1] + 1
再列一...
分类:
其他好文 时间:
2014-09-10 21:10:51
阅读次数:
211
字典:pytho中唯一映射类型,无序列表(哈希表)对象是可变的,但字典的键必须使用不可变对象,并且一个字典中可以使用不同类型的键值定义方法:-{}如:dic={name:‘zzc‘,age:19,gender:‘man‘}-使用工厂方法dict()列fdict=dice([‘x‘,1],[‘y‘,2])-内建方法:fromkeys()字典..
分类:
编程语言 时间:
2014-09-05 18:28:42
阅读次数:
253
题目链接:http://acm.hdu.edu.cn/search.php?field=problem&key=2013 ACM-ICPC南京赛区全国邀请赛——题目重现&source=1&searchmode=source
A(HDU4586)
Play the Dice
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 6553...
分类:
其他好文 时间:
2014-08-31 11:59:21
阅读次数:
383
TautologyTime Limit:1000MSMemory Limit:65536KTotal Submissions:9580Accepted:3640DescriptionWFF 'N PROOF is a logic game played with dice. Each die has...
分类:
其他好文 时间:
2014-08-28 16:50:50
阅读次数:
289
#include #include #include int main(){ using namespace std; int casts[10]={6,7,2,9,4,11,8,7,10,5}; vector dice(10); copy(casts,casts+10,di...
分类:
其他好文 时间:
2014-08-15 20:57:09
阅读次数:
195
HDU 4599 Dice(概率dp推导,模的逆元求解)...
分类:
其他好文 时间:
2014-08-12 10:27:03
阅读次数:
263
One Person Game
Time Limit: 1 Second Memory Limit: 32768 KB Special Judge
There is a very simple and interesting one-person game. You have 3 dice, namely Die1, Die2 and Die3. Die1 ha...
分类:
其他好文 时间:
2014-07-31 20:51:57
阅读次数:
311
Aeroplane chess
Problem Description
Hzz loves aeroplane chess very much. The chess map contains N+1 grids labeled from 0 to N. Hzz starts at grid 0. For each step he throws a dice(a dice hav...
分类:
其他好文 时间:
2014-07-31 09:49:57
阅读次数:
208