摘要: 若某事件发生的概率为P,则期望为1/P。 题目链接:https://vjudge.net/contest/222921 密码:ECJTUACM A: 有若干个传送门,你会随机选择其中一扇,值为a的传送门会让你在a分钟后离开, 值为-a的传送门会让你在a分钟后回到起点,求离开的期望时间。 若能离开的传 阅读全文
posted @ 2018-05-03 21:01 诚信肥宅 阅读(351) 评论(3) 推荐(1) 编辑
摘要: 线性代数的计算: 其中cij为a中第i竖列与b中第j横行对应乘积的合 如:c11=a11*b11+a21*b12+…+an1*b1n cij=a1i*bj1+a2i*bj2+…+ani*bjn 矩阵: 对于上述计算中的集合a,b,我们可以称之为矩阵 矩阵乘法: f(n)=f(n-1)+f(n-2) 阅读全文
posted @ 2018-04-15 20:27 诚信肥宅 阅读(391) 评论(0) 推荐(1) 编辑
摘要: 辗转相除法: int gcd(int x,int y) { return y>0?gcd(y,x%y):x; } 相信大部分人都比较熟悉了,简单又快速的求最大公约数的利器,甚至不需要知道原理也不影响使用。 现在讲解一下原理及其证明: 这张图的运算流程如下: 1350%211=84 211%84=43 阅读全文
posted @ 2018-03-28 20:06 诚信肥宅 阅读(1638) 评论(0) 推荐(1) 编辑
摘要: I. Shell Game time limit per test 1.0 s memory limit per test 256 MB input standard input output standard output I. Shell Game time limit per test 1.0 阅读全文
posted @ 2018-01-10 20:12 诚信肥宅 阅读(364) 评论(0) 推荐(0) 编辑
摘要: D. Shovel Sale time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output There are n shovels in Pol 阅读全文
posted @ 2017-12-19 17:17 诚信肥宅 阅读(417) 评论(0) 推荐(0) 编辑
摘要: E. Squares and not squares time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Ann and Borya 阅读全文
posted @ 2017-12-19 17:05 诚信肥宅 阅读(265) 评论(0) 推荐(0) 编辑
摘要: Gym - 101522A There are two popular formats for representing a date: day/month/year or month/day/year. For example, today can be represented as 15/8/2 阅读全文
posted @ 2017-12-07 19:15 诚信肥宅 阅读(996) 评论(0) 推荐(0) 编辑
摘要: Grandpa's Estate Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 14454 Accepted: 4042 Description Being the only living descendant of his g 阅读全文
posted @ 2017-12-02 17:43 诚信肥宅 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 凸多边形:任意两个顶点的连线都在多边形内部,这样的多边形称为凸多边形 凸包的定义:一个凸多边形的顶点的集合 求凸包的一般形式:给出一个点集,求出覆盖所有点的最小凸多边形 Graham算法:时间复杂度:O(nlogn)极角排序耗时先取出一个端点,必须为凸包上的一个点,取最下且最右的点即可以端点进行极角 阅读全文
posted @ 2017-12-02 15:03 诚信肥宅 阅读(454) 评论(0) 推荐(0) 编辑
摘要: The most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y1999 an 阅读全文
posted @ 2017-12-02 15:02 诚信肥宅 阅读(177) 评论(0) 推荐(0) 编辑