上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 60 下一页
摘要: Discription Levko loves strings of length n, consisting of lowercase English letters, very much. He has one such string s. For each string t of length 阅读全文
posted @ 2018-05-03 13:13 蒟蒻JHY 阅读(579) 评论(0) 推荐(0) 编辑
摘要: 题目描述 管道取珠是小X很喜欢的一款游戏。在本题中,我们将考虑该游戏的一个简单改版。游戏画面如图1所示: (图1) 游戏初始时,左侧上下两个管道分别有一定数量的小球(有深色球和浅色球两种类型),而右侧输出管道为空。每一次操作,可以从左侧选择一个管道,并将该管道中最右侧的球推入右边输出管道。 例如:我 阅读全文
posted @ 2018-05-03 11:14 蒟蒻JHY 阅读(253) 评论(0) 推荐(0) 编辑
摘要: Discription n fish, numbered from 1 to n, live in a lake. Every day right one pair of fish meet, and the probability of each other pair meeting is the 阅读全文
posted @ 2018-05-03 09:54 蒟蒻JHY 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 次大公约数就是gcd再除以其最小质因子(如果有的话)。可以发现要求的sgcd 的前身gcd都是a1的约数,所以把a1质因数分解直接做就行了。 阅读全文
posted @ 2018-05-02 20:44 蒟蒻JHY 阅读(245) 评论(0) 推荐(0) 编辑
摘要: Discription By the age of three Smart Beaver mastered all arithmetic operations and got this summer homework from the amazed teacher: You are given a 阅读全文
posted @ 2018-05-02 20:18 蒟蒻JHY 阅读(367) 评论(0) 推荐(0) 编辑
摘要: Discription Smart Beaver decided to be not only smart, but also a healthy beaver! And so he began to attend physical education classes at school X. In 阅读全文
posted @ 2018-05-02 18:40 蒟蒻JHY 阅读(275) 评论(0) 推荐(0) 编辑
摘要: 题目描述 给定一棵n 个点的树,每条边上都有一个权值。现在按顺序删掉所有的n-1条边,每删掉一条边询问当前有多少条路径满足路径上所有边权值异或和为0。 输入输出格式 输入格式: 第一行一个整数n。 接下来n-1 行,每行三个整数ai,bi, zi,满足1<= ai, bi <=n,表示树上编号为ai 阅读全文
posted @ 2018-05-02 15:20 蒟蒻JHY 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 题目描述 刚开始你有一个数字0,每一秒钟你会随机选择一个[0,2^n-1]的数字,与你手上的数字进行位或 (即c++中的 '|' ) 操作。 选择数字i的概率是p[i]。保证0<=p[i]<=1,Σp[i]=1问期望多少秒后,你手上的数字变成2^n-1。 输入输出格式 输入格式: 第一行输入n表示n 阅读全文
posted @ 2018-05-02 12:12 蒟蒻JHY 阅读(535) 评论(0) 推荐(0) 编辑
摘要: 正着求不太好求,,但是不是剪刀石头布的又很好表示:三个人中恰好有一个人赢了两场。 所以我们考虑让这种三元组数量最少使得剪刀石头布最多。 考虑一个人如果赢了i场,那么他对 非剪刀石头布的三元组的贡献是 -> i(i-1)/2 ,也就是他和任意两个被他击败的人都可以组成三元组。并且每个人的贡献都是独立的 阅读全文
posted @ 2018-05-02 09:48 蒟蒻JHY 阅读(362) 评论(0) 推荐(0) 编辑
摘要: 转化一下模型:每天可以选1也可以选0,但是任意前i天(i<=n)1的个数都必须>=0的个数,求总方案数/2^n。 然后可以发现这是一个经典题,随便推一下公式发现等于 C(n,n/2)/2^n [请在二维平面直角坐标系上自行演算,(x,y)可以到 (x+1,y)和(x,y+1),横坐标代表1的个数,纵 阅读全文
posted @ 2018-05-01 20:09 蒟蒻JHY 阅读(176) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 60 下一页