Harmonic Number (II) Description I was trying to solve problem '1234 - Harmonic Number', I wrote the following code long long H( int n ) { long long r ...
分类:
其他好文 时间:
2016-08-18 21:15:02
阅读次数:
123
题目大意:给出长度为n的一条隧道,每个位置都有一定数量的财宝。给你一枚骰子,roll到几点就前进几步,如果即将到达的地方超过了这条隧道长度,就重新roll一次,走到n点结束。求这个过程能收获多少财宝。 题目思路:很明显问题是求期望值的。 期望值公式: E(X) = X1*p(X1) + X2*p(X ...
分类:
其他好文 时间:
2016-08-18 21:02:06
阅读次数:
137
C - Throwing Dice Time Limit:2000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu LightOJ 1064 uDebug C - Throwing Dice Time Limit:2000MS Memory Li ...
题目链接:http://lightoj.com/volume_showproblem.php?problem=1058 ...
分类:
其他好文 时间:
2016-08-14 17:56:22
阅读次数:
260
题目大意:给你n个点,求这n个点最多能组成多少个平行四边形。 题目思路:这道题卡时间,而且卡内存。你要尽可能的想办法优化。 平行四边形的判定定理: 两组对边分别平行的四边形是平行四边形(定义判定法); 一组对边平行且相等的四边形是平行四边形; 两组对边分别相等的四边形是平行四边形; 两组对角分别相等 ...
分类:
其他好文 时间:
2016-08-14 07:42:13
阅读次数:
201
Description Sometimes some mathematical results are hard to believe. One of the common problems is the birthday paradox. Suppose you are in a party wh ...
分类:
其他好文 时间:
2016-08-13 21:01:39
阅读次数:
314
题目链接:http://lightoj.com/volume_showproblem.php?problem=1118 给你两个圆的半径和圆心,求交集的面积; 就是简单数学题,但是要注意acos得到的都是小于180度的角,所以这里要注意一下,不要求整个角,求一半的大小;这点让我错的惨不忍睹; #in ...
分类:
其他好文 时间:
2016-08-13 15:33:59
阅读次数:
176
Leading and Trailing You are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits o ...
分类:
其他好文 时间:
2016-08-12 21:36:08
阅读次数:
114