D. GukiZ and Binary Operations time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output We all know that GukiZ often plays with arrays. Now he is thinking about this problem: how many arrays a, of l…
实际上是水水题叻,先把朴素DP方程写出来,发现$dp[i]$实际上是$dp[i-k]-dp[i-1]$的和,而看数据范围,我们实际上是要快速地求得这段的和,突然就意识到是矩阵快速幂叻. 构建矩阵什么的还是很简单滴,主要就是练一练手. (还有就是水一水blog!换个字体,换个心情! (快速乘是在模数很大时要用,避免超long long #include<bits/stdc++.h> using namespace std; #define LL long long #define mod 777…
CRB and Puzzle Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 558 Accepted Submission(s): 227 Problem Description CRB is now playing Jigsaw Puzzle.There are N kinds of pieces with infinite s…