这道题比较考验(高中)数学知识,主要用到乘法逆元、多项式奇数项之和与快速幂取模三个知识点。 乘法逆元:设整数a、x、m(a与m互质),若x*a=1 mod m则x就是a对m的乘法逆元。一个数除以a后对m取模的结果等于这个数乘以a对m的逆元对m取模的结果。 乘法逆元的计算要用到扩展欧几里得算法: 基本 ...
分类:
其他好文 时间:
2017-09-17 13:50:26
阅读次数:
299
Bob has a not even coin, every time he tosses the coin, the probability that the coin's front face up is qp(qp≤12)\frac{q}{p}(\frac{q}{p} \le \frac{1} ...
分类:
其他好文 时间:
2017-09-17 13:48:47
阅读次数:
394
Bob has a not even coin(就是一个不均匀的硬币,朝上的概率不一定是1/2), every time he tosses the coin, the probability that the coin's front face up is q/p(q/p<=1/2). The q ...
分类:
其他好文 时间:
2017-09-17 13:36:10
阅读次数:
292
题目链接: https://nanti.jisuanke.com/t/17115 题意: 询问硬币K次,正面朝上次数为偶数。 思路: dp[i][0] = 下* dp[i-1][0] + 上*dp[i-1][1] (满足条件的) dp[i][1]= 上*dp[i-1][0] + 下*dp[i-1][ ...
分类:
其他好文 时间:
2017-09-16 23:20:56
阅读次数:
221
题意:投一枚硬币向上的概率是q/p。问你投K枚硬币,向上的枚数为偶数枚的概率是? 要求的即为。 这个东西是个二项展开式的偶数项系数和,来,我们复习一下高中数学,设f(x)=(ax+b)^n,则其偶数项系数和为(f(1)+f(-1))/2。 ...
分类:
其他好文 时间:
2017-09-16 20:25:15
阅读次数:
202
A. Tree 题库链接 通过率: 41.8 % 通过人数: 51 B. Coin 题库链接(√) 通过率: 73.25 % 通过人数: 734 C. Sum 题库链接(√) 通过率: 91.44 % 通过人数: 1121 D. Brain-baffling Game 题库链接 通过率: 4.55 ...
分类:
其他好文 时间:
2017-09-16 18:42:57
阅读次数:
506
P2964 [USACO09NOV]硬币的游戏A Coin Game P2964 [USACO09NOV]硬币的游戏A Coin Game P2964 [USACO09NOV]硬币的游戏A Coin Game 题目描述 Farmer John's cows like to play coin gam ...
分类:
其他好文 时间:
2017-09-14 16:36:47
阅读次数:
212
今年上半年,随着以比特币为代表的虚拟货币价格暴增,ICO(Initial Coin Offering 首次代币发行)这种新型融资方式在国内迅速发展,大量山寨币层出不穷。光上半年,通过ICO获得的融资金额已经超过了传统VC的投资,ICO累计融资规模达26.16亿元人民币。 乱象丛生、折射黄金光芒的 I ...
分类:
其他好文 时间:
2017-09-06 00:35:52
阅读次数:
156
Problem Description A weird clock marked from 0 to 59 has only a minute hand. It won’t move until a special coin is thrown into its box. There are dif ...
分类:
其他好文 时间:
2017-08-19 21:17:41
阅读次数:
195
Given coins of certain denominations and a total, how many ways these coins can be combined to get the total. Dynamic Programming solution State: T[i] ...
分类:
其他好文 时间:
2017-08-18 14:41:37
阅读次数:
122