摘要: 注意点:1.矩阵运算规则:题解里讲的很详细。 2.这个题只能用while型的快速幂,不能用递归型的,会TLE。 3.极其坑爹的一点:常量定义居然不能用define,只能用const??判定非常迷,卡了我3个小时! 上AC代码 1 #include<bits/stdc++.h> 2 //#define 阅读全文
posted @ 2021-08-19 14:00 Wag_Ho 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 39171373917139397 本人原创,如有雷同,纯属巧合 阅读全文
posted @ 2021-08-18 09:08 Wag_Ho 阅读(88) 评论(5) 推荐(1) 编辑
摘要: 话不多说,贴代码 1 inline int read() { 2 bool flag = false; int x = 0; 3 char ch = getchar(); 4 5 while (ch < '0' || ch > '9') { 6 if (ch == '-') flag = true; 阅读全文
posted @ 2021-08-17 13:16 Wag_Ho 阅读(46) 评论(4) 推荐(1) 编辑
摘要: 1 #include<iostream> 2 #include<string> 3 #include<ctime> 4 #include<cstdlib> 5 #include<windows.h> 6 #include<conio.h> 7 8 using namespace std; 9 10 阅读全文
posted @ 2021-07-06 11:25 Wag_Ho 阅读(866) 评论(4) 推荐(0) 编辑
摘要: 以最大连续子序列和算法为例。 算法源代码: 1 #include<bits/stdc++.h> 2 #define N 1000000 3 using namespace std; 4 5 int n; 6 int a[N],dp[N]; 7 int MAXN=-(1<<30); 8 9 int m 阅读全文
posted @ 2021-05-28 22:59 Wag_Ho 阅读(67) 评论(4) 推荐(1) 编辑
摘要: 地址:http://ybt.ssoier.cn:8088/problem_show.php?pid=1352 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 vector<int> mp[105];//图(邻接表) 5 queue<int> 阅读全文
posted @ 2021-04-10 11:59 Wag_Ho 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 和1350是同一个题 地址:http://ybt.ssoier.cn:8088/problem_show.php?pid=1349 Prim代码: 1 #include<bits/stdc++.h> 2 #define INF 0x3f3f3f3f 3 using namespace std; 4 阅读全文
posted @ 2021-04-10 11:57 Wag_Ho 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 地址:http://ybt.ssoier.cn:8088/problem_show.php?pid=1348 1 #include<bits/stdc++.h> 2 using namespace std; 3 4 int n,m,num; 5 struct edge{ 6 int a,b,c; 7 阅读全文
posted @ 2021-04-10 11:50 Wag_Ho 阅读(549) 评论(0) 推荐(0) 编辑
摘要: 地址:http://ybt.ssoier.cn:8088/problem_show.php?pid=1392 #include<bits/stdc++.h> using namespace std; int n,m,num; struct edge{ int a,b,c; }mp[90005];// 阅读全文
posted @ 2021-04-10 11:46 Wag_Ho 阅读(383) 评论(0) 推荐(0) 编辑
摘要: 地址:http://ybt.ssoier.cn:8088/problem_show.php?pid=1381 邻接表代码(Bellman_Ford): 1 #include<bits/stdc++.h> 2 #define INF 0x3f3f3f3f 3 using namespace std; 阅读全文
posted @ 2021-04-10 11:35 Wag_Ho 阅读(180) 评论(0) 推荐(0) 编辑