数学-矩阵快速幂
文章平均质量分 90
Mitsuha_
Rush to the dead summer
展开
-
NC-14532:没有名字(矩阵快速幂+优化)
链接时间限制:C/C++ 5秒,其他语言10秒空间限制:C/C++ 32768K,其他语言65536K64bit IO Format: %lld题目描述tabris实在是太菜了,没打败恶龙,在绿岛也只捡到一块生铁回去了,为了不在继续拉低acimo星球的平均水平逃离地球,来到了Sabi星球.在这里tabris发现了一种神奇的生物,这种生物不需要与外界交流,种群间不同个体能互相维持生命存在及提供生长所需的能量.每个种群有N个不同个体,围成一个圈,每隔一个单位时间都会生长.在一个单位时间里,每个个原创 2022-04-23 16:34:34 · 783 阅读 · 0 评论 -
Codeforces-1152F:Neko Rules the Catniverse(DP+矩阵快速幂)
F2. Neko Rules the Catniverse (Large Version)time limit per test 7 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputThis problem is same as the previous one, bu...原创 2019-04-26 00:25:57 · 312 阅读 · 0 评论 -
Codeforces-1151F:Sonya and Informatics(DP+矩阵快速幂)
F. Sonya and Informaticstime limit per test 1 secondmemory limit per test 256 megabytesinput standard inputoutput standard outputA girl named Sonya is studying in the scientific lyceum of the Kin...原创 2019-04-19 11:09:57 · 342 阅读 · 0 评论 -
Codeforces-1106F:Lunar New Year and a Recursive Sequence(矩阵快速幂+BSGS)
F. Lunar New Year and a Recursive Sequencetime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLunar New Year is approaching, and Bob received a g...原创 2019-02-05 13:51:20 · 790 阅读 · 0 评论 -
ACM-ICPC 2018 徐州赛区网络预赛-K:Morgana Net(矩阵快速幂)
Morgana is learning Convolutional Neural Network, he builds a neural network called “morgana net”.In brief, given a N×NN×NN×N matrix AAA that represents a picture. Every layer in morgana net is doin...原创 2018-09-10 12:54:54 · 436 阅读 · 0 评论 -
WUST OJ-1288:Sequence(矩阵快速幂)
1288: SequenceTime Limit: 3 Sec Memory Limit: 128 MB 64bit IO Format: %lldSubmitted: 20 Accepted: 4[Submit][Status][Web Board]DescriptionYXH is very fond of the sequence. One day he found a very i...原创 2018-06-13 21:39:04 · 401 阅读 · 0 评论 -
Codeforces-954F:Runner's Problem(矩阵快速幂+离散化)
F. Runner's Problemtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are running through a rectangular field. This field can be represented as a...原创 2018-03-25 22:15:19 · 451 阅读 · 0 评论 -
ACM-ICPC 2017 Asia Urumqi: H. Count Numbers(DP+矩阵快速幂优化)
Now Alice wants to sum up all integers whose digit sum is exactly a^b.However we all know the number of this kind of integers are unlimited. So she decides to sum up all these numberswhose each digit ...原创 2018-02-28 08:31:29 · 885 阅读 · 0 评论 -
ACM-ICPC 2017 Asia Urumqi: D. Fence Building(递推//矩阵快速幂)
Farmer John owns a farm. He first builds a circle fence. Then, he will choose n points and build some straight fences connecting them. Next, he will feed a cow in each region so that cows cannot play ...原创 2018-02-10 21:52:22 · 511 阅读 · 0 评论 -
2017年浙江工业大学大学生程序设计迎新赛热身赛-E:递推(矩阵快速幂)
2017年浙江工业大学大学生程序设计迎新赛热身赛-E:递推(矩阵快速幂)JYM和XJ转眼就从小学上了高中。在学习递推的时候,JYM在纸上随手写了一个递推关系式:an=2*an-1,a0=0。写完这个递推式,JYM拿给XJ看,XJ觉得太过简单,于是大笔一挥,在等式右边又加了一个式子,变成了这样:an=2*an-1+n2。JYM看到这个式子,想要算几个项来看看,可是一算就发现这个数据量太大了,你能帮他解决这个问题吗?原创 2017-12-21 17:32:45 · 617 阅读 · 3 评论 -
hihocoder#1605 : 小Hi的生成树计数(矩阵快速幂)
时间限制:10000ms单点时限:1000ms内存限制:256MB描述小Hi最近对生成树(包含所有顶点的联通无环子图。)非常的感兴趣,他想知道对于特定的简单平面无向图是不是存在求生成树个数的简单方法。小Hi定义了这样的图:一个以{0,1,2……n}为顶点的图,顶点0与其他n个顶点直接相连,对于顶点i(1 ≤ i 请求出对于任意n,这样的图的生原创 2017-10-08 16:17:11 · 470 阅读 · 0 评论 -
hihocoder#1345 : 小h的朋友们(矩阵快速幂)
hihocoder#1345 : 小h的朋友们(矩阵快速幂)小h很多朋友。他给第i个朋友分配了一个代号Ai,并使代号序列满足如下关系:Ai = (k1 * Ai-1 + k2 * Ai-2) mod 1,000,000,007现在小h忘记了第z个朋友的代号Az,但是他记得第x个朋友和第y个朋友的代号Ax和Ay。小h很着急,向小y求助。小y很忙,把任务交给了你,希望你求出第z个朋友的代号。原创 2017-09-28 19:12:22 · 353 阅读 · 0 评论 -
2017 ACM/ICPC Asia Regional Shenyang Online:number number number
2017 ACM/ICPC Asia Regional Shenyang Online:number number numberWe define a sequence F:⋅ F0=0,F1=1;⋅ Fn=Fn−1+Fn−2 (n≥2).Give you an integer k, if a positive number n can be expressed byn=Fa1+Fa2+...+Fak where 0≤a1≤a2≤⋯≤ak, this positive number is mjf原创 2017-09-10 17:52:40 · 511 阅读 · 0 评论 -
POJ-3233:Matrix Power Series
POJ-3233:Matrix Power Series Given a n × n matrix A and a positive integer k, find the sum S = A + A2 + A3 + … + Ak.原创 2017-09-03 20:08:20 · 307 阅读 · 0 评论 -
2017 Multi-University Training Contest - Team 10 HDU-6172:Array Challenge
2017 Multi-University Training Contest - Team 10 HDU-6172:Array ChallengeThere’s an array that is generated by following rule.h0=2,h1=3,h2=6,hn=4hn−1+17hn−2−12hn−3−16And let us define two arrays bnandan as below.bn=3hn+1hn+9hn+1hn−1+9h2n+27hnhn−1−18hn+1原创 2017-08-28 14:02:15 · 383 阅读 · 0 评论 -
WUST OJ 1554: HLD's Fibonacci
1554: HLD's FibonacciTime Limit: 1 Sec Memory Limit: 128 MB 64bit IO Format: %lldDescriptionThe Fibonacci Numbers {0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 ...} are defined by the recurre原创 2017-07-29 16:41:05 · 542 阅读 · 0 评论