摘要:
Discription Hint: 对于 100% 的数据, n<=10^6。 阅读全文
posted @ 2018-04-17 21:26
蒟蒻JHY
阅读(216)
评论(0)
推荐(0)
摘要:
Discription 阅读全文
posted @ 2018-04-17 21:20
蒟蒻JHY
阅读(139)
评论(0)
推荐(0)
摘要:
Discription Everyone knows what the Fibonacci sequence is. This sequence can be defined by the recurrence relation: We'll define a new number sequence 阅读全文
posted @ 2018-04-17 20:15
蒟蒻JHY
阅读(225)
评论(0)
推荐(0)
摘要:
发现一个区间[L,R]代表的2进制数是3的倍数,当且仅当从L开始的后缀二进制值 - 从R+1开始的后缀二进制值 是 3 的倍数 (具体证明因为太简单而被屏蔽)。 于是我们就可以在每个点维护从它开始的后缀二进制数的值,因为在%3同余系下只有3个数,所以我们可以很容易的用线段树进行区间维护,然后答案就是 阅读全文
posted @ 2018-04-17 17:19
蒟蒻JHY
阅读(345)
评论(0)
推荐(0)
摘要:
显然答案具有单调性,可以二分。问题是 我们二分出一个 堆数,该怎么判定能否达到这个堆数呢? 我们可以很简单的用调整法证明,最底下的一层的冰淇淋肯定是最小的那些,往上叠加的话我们再贪心的让较少的放在较小的上面,答案总不会更劣。 于是就口胡完了2333 阅读全文
posted @ 2018-04-17 17:07
蒟蒻JHY
阅读(285)
评论(0)
推荐(0)
摘要:
Discription Given a simple graph, output the number of simple cycles in it. A simple cycle is a cycle with no repeated vertices or edges. Input The fi 阅读全文
posted @ 2018-04-17 15:50
蒟蒻JHY
阅读(565)
评论(0)
推荐(0)
摘要:
Problem Statement You are given a tree with N vertices. The vertices are numbered 0 through N−1, and the edges are numbered 1 through N−1. Edge i conn 阅读全文
posted @ 2018-04-17 08:55
蒟蒻JHY
阅读(415)
评论(0)
推荐(0)