摘要: 发现好像只记一行没什么太大的用了。怎么办…… 一行不行记两行呗!m=10的情况也只有60种可行方案,空间大大的有。 注意不是累加是取max…… 看代码: #include<bits/stdc++.h> using namespace std; int f[105][65][65]; int can[ 阅读全文
posted @ 2020-03-06 11:05 syzf2222 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 传说这种题叫什么旅行商问题? 这题卡记搜和暴搜,注意一下…… #include<bits/stdc++.h> using namespace std; const int maxn=20; int n,vis[maxn]; double x[maxn],y[maxn],ans,dist[maxn][ 阅读全文
posted @ 2020-03-06 00:22 syzf2222 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 几乎是板子。 #include<bits/stdc++.h> using namespace std; #define int long long int f[10][100][1000],ans; int n,k,cnt,iab[20],num[1000]; int can[1000],bai[2 阅读全文
posted @ 2020-03-05 22:49 syzf2222 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 将已有边权设为零,再跑kruskal…… #include<bits/stdc++.h> using namespace std; #define int long long const int maxn=50000; struct node{ int x,y,z; }a[maxn]; int n, 阅读全文
posted @ 2020-03-05 19:46 syzf2222 阅读(90) 评论(0) 推荐(0) 编辑
摘要: 网络流搜到的,标答却是dp…… 一道紫dp!!!!!!!!!!! f[i][j]代表在前i个中随意选j段的最大值。 g[i][j]代表在前i个中在选i的前提下选j段的最大值。 h[i][j]代表在前i个中在选1的前提下选j段的最大值。 l[i][j]代表在前i个中在选1和i的前提下选j段的最大值。 阅读全文
posted @ 2020-03-04 11:55 syzf2222 阅读(116) 评论(0) 推荐(0) 编辑
摘要: f[i][j]表示第i行状态为j时的方案数。 pd[i]用于判断第i行的一种方法是否合法。 f[i][j]=f[i-1][k],j&k==0,j&pd[i]==0,k&pd[i-1]==0 由于每行两两不相邻,所以可以预处理。 蒟蒻的第一道状压。 看代码: #include<stdio.h> #in 阅读全文
posted @ 2020-03-03 22:18 syzf2222 阅读(304) 评论(0) 推荐(0) 编辑
摘要: P1433 吃奶酪 SolutionP4970 全村最好的嘤嘤刀P1879 [USACO06NOV]玉米田Corn Fields SolutionP3475 [POI2008]POD-Subdivision of KingdomP3092 [USACO13NOV]No Change GP3052 [ 阅读全文
posted @ 2020-03-03 20:13 syzf2222 阅读(274) 评论(0) 推荐(0) 编辑
摘要: 超级源点向每个集合连权值为这个集合的值的边,每个集合向每个元素连权值为极大值的边,每个元素向超级汇点连权值为其花费的边。 答案即为集合值的和减去最大流(最小割) 看代码: #include<bits/stdc++.h> using namespace std; #define int long lo 阅读全文
posted @ 2020-03-03 17:15 syzf2222 阅读(128) 评论(0) 推荐(0) 编辑
摘要: - [P3410 拍照] Solution- [P4744 [Wind Festival] Solution- [P2765 魔术球问题] Solution- [P2711 小行星] Solution- [P4055 [JSOI2009]游戏](https://www.luogu.com.cn/pr 阅读全文
posted @ 2020-03-03 15:32 syzf2222 阅读(455) 评论(2) 推荐(1) 编辑
摘要: 求最大连通块…… #include<bits/stdc++.h> using namespace std; const int maxn=1e7+10; const int maxm=2*1e5+10; int vis[maxn]; int beg[maxn],nex[maxn],to[maxn], 阅读全文
posted @ 2020-03-02 09:35 syzf2222 阅读(101) 评论(0) 推荐(0) 编辑