随笔分类 -  模板题目

摘要:P3390 【模板】矩阵快速幂 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 105, mod = 1e9+7; 5 ll n, k; 6 struct MAT 阅读全文
posted @ 2019-10-31 13:01 麻辣猪仔 阅读(113) 评论(0) 推荐(0)
摘要:最短Hamilton路径 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn = 21; 4 int dp[1<<maxn][maxn]; 5 int maps[maxn][maxn]; 6 int main() { 7 阅读全文
posted @ 2019-10-30 12:11 麻辣猪仔 阅读(105) 评论(0) 推荐(0)
摘要:hdu3652 B-number 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 15; 4 int dp[maxn][maxn][maxn][maxn]; 5 // dp[i][j][state][r] i表 阅读全文
posted @ 2019-10-29 22:13 麻辣猪仔 阅读(88) 评论(0) 推荐(0)
摘要:hdu2089 不要62 1 #include <bits/stdc++.h> 2 using namespace std; 3 int dp[15][15], d[15]; 4 void init() { 5 dp[0][0] = 1; 6 for (int i = 1; i <= 7; i++) 阅读全文
posted @ 2019-10-29 21:31 麻辣猪仔 阅读(150) 评论(0) 推荐(0)
摘要:P1880 [NOI1995]石子合并 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 205; 4 const int inf = 0x3f3f3f3f; 5 int cost1[maxn][maxn], c 阅读全文
posted @ 2019-10-29 21:14 麻辣猪仔 阅读(132) 评论(0) 推荐(0)
摘要:P2444 [POI2000]病毒 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 35000; 4 5 struct Aho_Corasock_Automaton { 6 struct node { 7 in 阅读全文
posted @ 2019-10-29 17:07 麻辣猪仔 阅读(158) 评论(0) 推荐(0)
摘要:noi7219 复杂的整数划分问题 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 55; 4 int dp1[maxn][maxn], dp2[maxn][maxn], dp3[maxn][maxn], dp 阅读全文
posted @ 2019-10-27 22:04 麻辣猪仔 阅读(156) 评论(0) 推荐(0)
摘要:POJ3468 A Simple Problem with Integers 1 #include <iostream> 2 #include <cstdio> 3 #include <algorithm> 4 #include <cmath> 5 using namespace std; 6 ty 阅读全文
posted @ 2019-10-26 21:47 麻辣猪仔 阅读(135) 评论(0) 推荐(0)
摘要:POJ3275 Ranking the Cows 1 #include <iostream> 2 #include <cstdio> 3 #include <bitset> 4 using namespace std; 5 const int maxn = 1005; 6 int n, m; 7 b 阅读全文
posted @ 2019-10-26 20:20 麻辣猪仔 阅读(198) 评论(0) 推荐(0)
摘要:P4779 【模板】单源最短路径(标准版) 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 1e5+5, inf = 0x3f3f3f3f; 5 struct E 阅读全文
posted @ 2019-10-26 20:00 麻辣猪仔 阅读(218) 评论(0) 推荐(0)
摘要:P3371 【模板】单源最短路径(弱化版) 1 #include<bits/stdc++.h> 2 using namespace std; 3 const int maxn = 10005; 4 struct edge { 5 int v, w; 6 }; 7 vector<edge> maps[ 阅读全文
posted @ 2019-10-26 19:50 麻辣猪仔 阅读(175) 评论(0) 推荐(0)
摘要:P3385 【模板】负环 Bellman-Ford 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 2005, maxm = 3005; 4 const int inf = 0x3f3f3f3f; 5 stru 阅读全文
posted @ 2019-10-26 18:05 麻辣猪仔 阅读(125) 评论(0) 推荐(0)
摘要:Holy Grail Bellman-Ford 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 305, maxm = 505; 4 const int inf = 0x3f3f3f3f; 5 struct e 阅读全文
posted @ 2019-10-26 16:05 麻辣猪仔 阅读(143) 评论(0) 推荐(0)
摘要:hdu6470 Count 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 6, mod = 123456789; 5 6 struct MAT { 7 ll a 阅读全文
posted @ 2019-10-26 14:36 麻辣猪仔 阅读(168) 评论(0) 推荐(0)
摘要:P3649 [APIO2014]回文串 1 #include <bits/stdc++.h> 2 using namespace std; 3 typedef long long ll; 4 const int maxn = 300010; 5 char s[maxn]; 6 int n; 7 st 阅读全文
posted @ 2019-10-26 13:45 麻辣猪仔 阅读(110) 评论(0) 推荐(0)
摘要:POJ2774 Long Long Message 两串求最长公共子串 1 #include <iostream> 2 #include <cstdio> 3 #include <cstring> 4 #include <algorithm> 5 using namespace std; 6 con 阅读全文
posted @ 2019-10-25 20:53 麻辣猪仔 阅读(163) 评论(0) 推荐(0)
摘要:P3975 [TJOI2015]弦论 在原串所有子串中求字典序第k大的子串 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 1e6+5; 4 char s[maxn]; 5 int a[maxn], c[max 阅读全文
posted @ 2019-10-25 19:44 麻辣猪仔 阅读(160) 评论(0) 推荐(0)
摘要:P2408 不同子串个数 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 1e5+5; 4 typedef long long ll; 5 char s[maxn]; 6 int sa[maxn], t[max 阅读全文
posted @ 2019-10-24 21:26 麻辣猪仔 阅读(169) 评论(0) 推荐(0)
摘要:P3804 【模板】后缀自动机 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn = 2e6+5; 4 typedef long long ll; 5 char s[maxn]; 6 int a[maxn], c[m 阅读全文
posted @ 2019-10-24 20:33 麻辣猪仔 阅读(119) 评论(0) 推荐(0)
摘要:POJ - 3693 Maximum repetition substring 题意 输入一个串,求重复次数最多的连续重复字串,如果有次数相同的,则输出字典序最小的 Sample input ccabababc daabbccaa # Sample Output Case 1: ababab Cas 阅读全文
posted @ 2019-10-24 13:40 麻辣猪仔 阅读(120) 评论(0) 推荐(0)