题意:有两个箱子,每个箱子里面都有n个糖果,每次LazyChild会选一个箱子,并吃掉一个糖果,如果里面没有糖果,则去另一个箱子去吃LazyChild 选第一个箱子的概率为 p,选择第二个箱子的概率为q=1-p求:当LazyChild选择一个箱子时,里面没有糖果了,另一个箱子里糖果数量的期望因为要使...
分类:
其他好文 时间:
2014-08-01 15:26:41
阅读次数:
156
Children of the Candy CornTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 9528Accepted: 4126DescriptionThe cornfield maze is a popular Hallow...
分类:
其他好文 时间:
2014-07-30 23:18:55
阅读次数:
436
Animesh has N empty candy jars, numbered from 1 to N, with infinite capacity. He performs M operations. Each operation is described by 3 integers a, b...
分类:
其他好文 时间:
2014-07-30 11:53:43
阅读次数:
221
题目:There are N children standing in a line. Each child is assigned a rating value. You are giving candies to these children subjected to the followin....
分类:
编程语言 时间:
2014-07-30 09:45:23
阅读次数:
200
1 DATA _NULL; /*_NULL_使得系统不需要生成一个新的数据集,以节省内存*/ 2 INFILE 'C:\MYRAWDATA\Candy.dat'; 3 INPUT Name $ 1-11 class @15 DateReturned MMDDYY10. Candyt...
分类:
其他好文 时间:
2014-07-24 22:34:22
阅读次数:
379
题目要求比其高的邻居要比本身的奖励多,那么最少也要多一个,所有我们可以找到所有的凹点,凹点如下三种情形。
找到所有的凹点后,我们就可以从凹点处开始向左右两个方向依次查找递增序列,其中每个高的都要比相邻的矮的多一个,比如1,2,5,4.我们找到凹点为1 和4,那么从1开始向左没有其他点,我们向右,依次得到2 比1高,2的糖果应该是1的基础上加1,为2, 5比2高,5的糖果是在2的基础上加1...
分类:
编程语言 时间:
2014-07-18 23:14:20
阅读次数:
373
Children of the Candy Corn
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9311
Accepted: 4039
Description
The cornfield maze is a popular Hallowee...
分类:
其他好文 时间:
2014-07-17 21:09:46
阅读次数:
319
Children of the Candy CornDescriptionThe cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze...
分类:
其他好文 时间:
2014-07-16 12:29:26
阅读次数:
264
题目链接:
点我点我
题目:
An Awful Problem
Time Limit: 1 Second Memory Limit: 32768 KB
In order to encourage Hiqivenfin to study math, his mother gave him a sweet candy when the day of the mo...
分类:
其他好文 时间:
2014-07-10 19:29:30
阅读次数:
315
题目
There are N children standing in a line. Each child is assigned a rating value.
You are giving candies to these children subjected to the following requirements:
Each child must have...
分类:
其他好文 时间:
2014-06-30 17:18:04
阅读次数:
177