摘要:
Discription HOHO,终于从Speakless手上赢走了所有的糖果,是Gardon吃糖果时有个特殊的癖好,就是不喜欢将一样的糖果放在一起吃,喜欢先吃一种,下一次吃另一种,这样;可是Gardon不知道是否存在一种吃糖果的顺序使得他能把所有糖果都吃完?请你写个程序帮忙计算一下。 Input 阅读全文
摘要:
Discription Given a text s[1..n] of length n, we create its suffix array by taking all its suffixes: s[1..n], s[2..n],...., s[n..n] and sorting them l 阅读全文
摘要:
Discription Volodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is d 阅读全文
摘要:
Discription 单身! 依然单身! 吉哥依然单身! DS级码农吉哥依然单身! 所以,他生平最恨情人节,不管是214还是77,他都讨厌! 吉哥观察了214和77这两个数,发现: 2+1+4=7 7+7=7*2 77=7*11 最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌 阅读全文
摘要:
Discription 给定一棵n个节点的树,从1到n标号。选择k个点,你需要选择一些边使得这k个点通过选择的边联通,目标是使得选择的边数最少。 现需要计算对于所有选择k个点的情况最小选择边数的总和为多少。 样例解释: 一共有三种可能:(下列配图蓝色点表示选择的点,红色边表示最优方案中的边) 选择点 阅读全文
摘要:
Discription You are given two multisets A and B. Each multiset has exactly n integers each between 1 and n inclusive. Multisets may contain multiple c 阅读全文
摘要:
Discription A group of n cities is connected by a network of roads. There is an undirected road between every pair of cities, so there are roads in to 阅读全文