摘要:
记得每次求gcd不然会爆掉。 思路:到k张时。我们还有n-k张没有得到。所以我们得到的概率为n-k/n; 所以到k+1步的期望时n/n-k; 整理得 n* 1/i(n>i>1)的累加 阅读全文
摘要:
解题思路: 我们假设一场游戏的一个子情况是0111011011,那么这个对结果的贡献是(3^m+2^m+2^m)*P(这种情况发生的概率) 将此式拆开==> 3^m*P+2^m*P+2^m*P 我们考虑3^m*P这部分,等价于3^m*P1*P2(P1为前五个点为01110的概率,P2为后面为1101 阅读全文
摘要:
找规律看https://www.cnblogs.com/solvit/p/9507207.html 阅读全文
摘要:
分块矩阵快速幂 构造 0 1 0 fn-2 fn-1 c d 1 * fn-1 = fn 0 0 1 p/i p/i 阅读全文
摘要:
Swordsman Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submission(s): 1740 Accepted Submission(s): 498 Pro 阅读全文
摘要:
板子题,注意内切要算。以及判断优劣弧的时候。用距离或者是弦的左右来判断。 我写的时候对优劣弧的定义弄反了,没改。我用的距离判断。 阅读全文
摘要:
链接:https://www.nowcoder.com/acm/contest/145/C 来源:牛客网 题目描述 A binary string s of length N = 2n is given. You will perform the following operation n times : - Choose one of the operators AND (&), OR ... 阅读全文
摘要:
Fruit Ninja is a juicy action game enjoyed by millions of players around the world, with squishy,splat and satisfying fruit carnage! Become the ultima 阅读全文
摘要:
搜索。 转3次。跟行列又重复就返回; 阅读全文
摘要:
如图二 根据容斥原理S=S1-S2-S3+S4;;S1, S2, S3, S4都是以(x, y)为右下角,以(0, 0)为左上角的矩阵,问题就转化成了求这样的矩阵图一; 米黄色的面积表示有多少个完整的循环矩阵,下方白条及右方白条表示只有长或宽不完整的矩阵,橙黄色面积表示不完整的循环矩阵; 阅读全文