摘要: 打击犯罪 #include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<queue> using namespace std; const int N=1005; int f[N],g[N],a[N][ 阅读全文
posted @ 2021-11-01 22:08 Rekord 阅读(486) 评论(0) 推荐(0) 编辑
摘要: 奖金 来道拓扑排序。 #include<iostream> #include<cstdio> #include<cstring> #include<vector> #include<queue> using namespace std; const int N=1e4+5; vector<int> 阅读全文
posted @ 2021-10-31 13:47 Rekord 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 城市公交网建设问题 原来这叫Kruskal算法! #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; const int N=105; struct edge{ 阅读全文
posted @ 2021-10-31 13:27 Rekord 阅读(355) 评论(0) 推荐(0) 编辑
摘要: 搭配购买 并查集+01背包。 #include<iostream> #include<string> #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> using namespace std; const i 阅读全文
posted @ 2021-10-31 13:04 Rekord 阅读(229) 评论(0) 推荐(0) 编辑
摘要: 团伙 #include<iostream> #include<cstdio> #include<vector> #include<queue> #include<cstring> using namespace std; const int N=1005; vector<int> fri[N]; v 阅读全文
posted @ 2021-10-30 18:54 Rekord 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 格子游戏 二维并查集的经典模板了! #include<iostream> using namespace std; const int N=205; struct node{ int x,y; }f[N][N]; node findth(node k){ return (f[k.x][k.y].x= 阅读全文
posted @ 2021-10-30 18:28 Rekord 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 珍珠 #include<iostream> #include<cstring> #include<cstdio> using namespace std; #define inf 0x3f3f3f3f const int N=105; int mapp[N][N]; // int ans[N]; i 阅读全文
posted @ 2021-10-30 13:30 Rekord 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 刻录光盘 #include<iostream> #include<cstring> #include<cstdio> using namespace std; const int N=205; int n; int mapp[N][N]; int p[N]; int main(){ scanf("% 阅读全文
posted @ 2021-10-30 12:47 Rekord 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 最短路 加了自己能看懂的注释,变量名也尽量使用更贴合的单词。 #include<iostream> #include<cstdio> #include<cstring> #include<queue> using namespace std; const int inf = 0x3f3f3f3f; 阅读全文
posted @ 2021-10-29 23:01 Rekord 阅读(321) 评论(0) 推荐(1) 编辑
摘要: 城市路 注意: 两个城市之间可能有多条路。 #include<iostream> #include<cstring> #include<cmath> #define inf 0x3f3f3f3f using namespace std; const int N=2005; int mapp[N][N 阅读全文
posted @ 2021-10-27 22:55 Rekord 阅读(345) 评论(0) 推荐(0) 编辑