kongroo专题

E - Okabe and El Psy Kongroo CodeForces - 821E

Okabe likes to take walks but knows that spies from the Organization could be anywhere; that’s why he wants to know how many different walks he can take in his city safely. Okabe’s city can be represe

Codeforces Round #420 (Div. 2) E. Okabe and El Psy Kongroo(矩阵快速幂)

题目链接:http://codeforces.com/contest/821/problem/E dp[i][j]=dp[i-1][j-1]+dp[i-1][j]+dp[i-1][j+1]然后构造矩阵转移就行了。。。貌似没啥难度? 代码: #include<bits/stdc++.h>using namespace std;const int MAXN=105;cons

【codefoces821E】 Okabe and El Psy Kongroo【Dp+矩阵快速幂】

题目链接:https://vjudge.net/problem/CodeForces-821E 题意: 我们现在位于(0,0)处,目标是走到(K,0)处。 每一次我们都可以从(x,y)走到(x+1,y-1)或者(x+1,y)或者(x+1,y+1)三个位置之一,且 y <= c [ i ] 。 问我们从起点走到终点的行走方案数。 题解: 我也分不清这改叫递推还是DP 总之方程很好写