矩阵快速幂
mmk27
这个作者很懒,什么都没留下…
展开
-
HDU 5667 Sequence 矩阵快速幂 + 费马小定理
olion August will eat every thing he has found. Now there are many foods,but he does not want to eat all of them at once,so he find a sequence. fn=⎧⎩⎨⎪⎪1,ab,abfcn−1fn−2,n=1n=2otherwise He give...原创 2018-11-08 09:57:24 · 159 阅读 · 0 评论 -
HDU - 6185 Covering 矩阵快速幂
Bob's school has a big playground, boys and girls always play games here after school. To protect boys and girls from getting hurt when playing happily on the playground, rich boy Bob decided to cover...原创 2018-12-06 16:10:36 · 191 阅读 · 0 评论 -
2018 焦作网络赛 L Poor God Water 矩阵快速幂
题目链接:https://nanti.jisuanke.com/t/A2022 题解:因为第1 2 天吃的啥,可以确定出第三天的,所以我们可以得到可以由 12天的 推得 23 天的,因此这样就可以构造一个9*9的矩阵了。 #include <bits/stdc++.h> using namespace std; typedef long long ll; const ll mod...原创 2019-08-02 23:38:31 · 203 阅读 · 0 评论 -
2019 南昌网络赛 C Hello 2019 / CodeForces - 750ENew Year and Old Subsequence 线段树维护矩阵
题目链接:https://vjudge.net/problem/CodeForces-750E 题解:哇,原来这个也四个原题。。。。。。维护矩阵的还真是第一次做,这里就说一下CF那题的思路吧 因为最后要2017,那么我们分为5个子序列 空 2 20 201 2017 每一个都代表一个状态,并且维护一下得到他们最少删除字符的数量,因此我们加上某个字符,相应的数量就会发生变化,我们用矩阵来表示...原创 2019-09-13 10:31:49 · 170 阅读 · 0 评论