题目: Description YYF is a couragous scout. Now he is on a dangerous mission which is to penetrate into the enemy's base. After overcoming a series difficulties, YYF is now at the start of enemy's famous "mine road". This is a very long road, on w…
实际上是水水题叻,先把朴素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…