摘要:
注意点:1.矩阵运算规则:题解里讲的很详细。 2.这个题只能用while型的快速幂,不能用递归型的,会TLE。 3.极其坑爹的一点:常量定义居然不能用define,只能用const??判定非常迷,卡了我3个小时! 上AC代码 1 #include<bits/stdc++.h> 2 //#define 阅读全文
摘要:
39171373917139397 本人原创,如有雷同,纯属巧合 阅读全文
摘要:
话不多说,贴代码 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; 阅读全文
摘要:
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 阅读全文
摘要:
以最大连续子序列和算法为例。 算法源代码: 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 阅读全文
摘要:
地址: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> 阅读全文
摘要:
和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 阅读全文
摘要:
地址: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 阅读全文
摘要:
地址: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];// 阅读全文
摘要:
地址: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; 阅读全文