
----矩阵快速幂
Wang_128
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
HDU5015-233 Matrix
233 Matrix Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)原创 2016-09-13 20:15:16 · 291 阅读 · 0 评论 -
POJ3070-Fibonacci
Fibonacci Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 16092 Accepted: 11309 Description In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn =原创 2017-08-27 12:20:30 · 334 阅读 · 0 评论 -
POJ3735-Training little cats
Training little cats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 14605 Accepted: 3612 Description Facer's pet cat just gave birth to a brood of littl原创 2017-08-27 12:44:43 · 361 阅读 · 0 评论 -
HDU5793-A Boring Question
A Boring Question Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)原创 2017-09-05 18:45:49 · 331 阅读 · 0 评论 -
POJ3734-Blocks
Blocks Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7054 Accepted: 3410 Description Panda has received an assignment of painting a line of blocks. Sin原创 2017-08-23 22:32:45 · 339 阅读 · 0 评论 -
UVA11149-Power of Matrix
#include #include #include #include #include using namespace std; struct Matrix { long long int v[41][41]; Matrix() { memset(v,0,sizeof v); } }m,p; Matrix sum(Matrix a,原创 2016-09-04 23:51:20 · 322 阅读 · 0 评论 -
POJ3233-Matrix Power Series
Matrix Power Series Time Limit: 3000MS Memory Limit: 131072K Total Submissions: 24205 Accepted: 10057 Description Given a n × n matrix A and a positive integer k,原创 2017-08-23 23:01:04 · 287 阅读 · 0 评论 -
HDU5863-cjj's string game
cjj's string game Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)原创 2017-09-06 20:11:47 · 342 阅读 · 0 评论 -
HDU6172-Array Challenge
Array Challenge Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 153428/153428 K (Java/Others)原创 2017-08-29 23:15:52 · 478 阅读 · 0 评论 -
HDU6198-number number number
number number number Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)原创 2017-09-15 15:55:57 · 365 阅读 · 0 评论 -
HDU6185-Covering
Covering Time Limit: 5000/2500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)原创 2017-09-03 18:28:27 · 1296 阅读 · 0 评论 -
POJ2118-Firepersons
Firepersons Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 1153 Accepted: 512 Description The Association for Courtly Manners, an international organiza原创 2017-08-27 12:18:18 · 381 阅读 · 0 评论 -
POJ3420-Quad Tiling
Quad Tiling Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 4495 Accepted: 2050 Description Tired of the Tri Tiling game finally, Michael turns to a more原创 2017-08-27 12:11:55 · 1026 阅读 · 0 评论 -
HDU6050-Funny Function
Funny Function Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)原创 2017-07-27 22:56:46 · 1557 阅读 · 6 评论 -
UVA10689-Yet another Number Sequence
#include #include #include #include #include using namespace std; struct node { int m[3][3]; node() { memset(m,0,sizeof m); } }x,y,z,k; int mod; node mul(node p,node q)原创 2016-09-05 10:36:38 · 398 阅读 · 0 评论 -
UVA10655-Contemplation! Algebra
题目分析:有种错误的方法是这样的:利用已知的两个方程联立,求解出a和b,进而求出答案。这种方法之所以错,是因为这种方法有局限性。联立之后会得到一个二元一次方程,只有当该方程有实数解确切的说是当某个数据满足该方程有实数解时,这种方法得到的结果才有可能正确。显然,题中数据不可能这么片面。正确的方法是这样的: 令a+b=A,ab=B,S(n)=an+bn。则S(n)=an+bn=(a+b)(an-原创 2016-09-05 12:04:41 · 382 阅读 · 0 评论 -
UVA10870-Recurrences
#include #include #include #include #include using namespace std; #define ll long long ll f[20],mod; struct Matrix { ll v[20][20]; Matrix() { memset(v,0,sizeof v); } }m原创 2016-09-05 13:14:31 · 315 阅读 · 0 评论 -
UVA11551-Experienced Endeavour
#include #include #include #include #include using namespace std; #define ll long long ll a[55]; struct Matrix { ll v[55][55]; Matrix() { memset(v,0,sizeof v); } }k,l;原创 2016-09-05 15:10:14 · 296 阅读 · 0 评论 -
UVA1386-Cellular Automaton(循环矩阵)
#include #include #include #include #include using namespace std; #define ll long long ll mod; struct Matrix { ll v[550]; Matrix() { memset(v,0,sizeof v); } }p,l; Mat原创 2016-09-05 17:06:22 · 407 阅读 · 0 评论 -
HDU2276-Kiki & Little Kiki 2
Kiki & Little Kiki 2 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)原创 2017-01-23 21:38:17 · 298 阅读 · 0 评论 -
ACdream1093-matrices女神的正多面体(矩阵快速幂)
女神的正多面体 Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submit Statistic Next Problem Problem Description EOF女神灰常喜欢整齐的东西,例如多面体中最喜欢的就是正多面体。正多面体的定义为:原创 2016-09-05 19:45:17 · 426 阅读 · 0 评论 -
ZOJ2974-Just Pour the Water
Just Pour the Water Time Limit: 2 Seconds Memory Limit: 65536 KB Shirly is a very clever girl. Now she has two containers (A and B), each with some water. Every minute, she pours half of原创 2017-04-11 23:49:54 · 320 阅读 · 0 评论 -
ZUFE-无人能解的数学难题
解题思路:怎么都没想到题目描述里的233是有用的,可以发现a[1]=23+1+f[1],a[2]=233+2+f[2],a[3]=2333+3+f[3],所以令: a[x]=g[x]+h[x]+f[x]那么: h[x]=h[x−1]+1,g[x]=g[x−1]*10+3 得到一系列递推式:f[x]=A*f[x-1]+B*f[x−2],h[x]=h[x-1]+1,g[x]=g[x-1]*10+3,原创 2017-05-23 21:57:36 · 871 阅读 · 0 评论 -
HDU6030-Happy Necklace
Happy Necklace Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)原创 2017-05-07 18:20:17 · 544 阅读 · 0 评论 -
CodeForces 450B-Jzzhu and Sequences
Jzzhu and Sequencestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputJzzhu has invented a kind of sequences, they meet the following property:You ar...原创 2016-09-04 22:38:42 · 361 阅读 · 0 评论