LINK 题意:简单粗暴,求菲波那契数列每个数的m次的前n项和模1e9+7 思路:斐波那契通项式, 注意到有很多根号5,求二次剩余为5模1e9+7的解,显然我们可以直接找一个(383008016),然后拿来替代根号5,然后优化下,把中括号中共轭的两部分预处理下,然后由于是外部的一个指数m,从1枚举到 ...
分类:
其他好文 时间:
2017-08-18 22:34:43
阅读次数:
219
分析: 空间1MB。。。。 次数大于n/2是解题关键。 ...
分类:
其他好文 时间:
2017-08-18 22:28:09
阅读次数:
152
【BZOJ3170】[Tjoi 2013]松鼠聚会 有N个小松鼠,它们的家用一个点x,y表示,两个点的距离定义为:点(x,y)和它周围的8个点即上下左右四个点和对角的四个点,距离为1。现在N个松鼠要走到一个松鼠家去,求走过的最短距离。 Input 第一行给出数字N,表示有多少只小松鼠。0<=N<=1 ...
分类:
其他好文 时间:
2017-08-18 20:03:24
阅读次数:
136
Description 这个游戏上在一个无限大的棋盘上, 棋盘上只有一颗棋子在位置(x,y)(x,y>=0)棋盘的左下角是(0,0)Amphetamine每次都是第一个移动棋子,然后Amphetamine与Alphago轮流移动。每一轮可以做以下三种中的一种操作: 1)在同一行,将棋子从当前位置向左 ...
分类:
其他好文 时间:
2017-08-18 19:54:43
阅读次数:
99
Recently, researchers on Mars have discovered N powerful atoms. All of them are different. These atoms have some properties. When two of these atoms c ...
分类:
其他好文 时间:
2017-08-18 19:49:35
阅读次数:
134
As a basketball fan, Mike is also fond of collecting basketball player cards. But as a student, he can not always get the money to buy new cards, so s ...
分类:
其他好文 时间:
2017-08-18 18:45:11
阅读次数:
179
Power Network Time Limit: 2000MS Memory Limit: 32768K Total Submissions: 25108 Accepted: 13077 Description A power network consists of nodes (power st ...
分类:
Web程序 时间:
2017-08-18 14:32:24
阅读次数:
311
3295: [Cqoi2011]动态逆序对 Description 对于序列A,它的逆序对数定义为满足i<j,且Ai>Aj的数对(i,j)的个数。给1到n的一个排列,按照某种顺序依次删除m个元素,你的任务是在每次删除一个元素之前统计整个序列的逆序对数。 对于序列A,它的逆序对数定义为满足i<j,且A ...
分类:
其他好文 时间:
2017-08-18 12:33:30
阅读次数:
178
A Telephone Line Company (TLC) is establishing a new telephone cable network. They are connecting several places numbered by integers from 1 to N. No ...
分类:
Web程序 时间:
2017-08-18 09:34:54
阅读次数:
229
总情况为n^m种,不越狱第一个房间为m种,后面的n-1个房间要与前面的不同,所以都只有m-1种。 ...
分类:
其他好文 时间:
2017-08-17 12:52:21
阅读次数:
121