随笔分类 -  ACM / 图论

摘要:https://vjudge.net/problem/POJ-3723 n个女的,m个男的,选择一个战士需要花费10000,如果有亲密关系,需要花费10000-d; 花费最小 用了cin加了优化超时了,后来改了scanf之后答案错误 后来把e等从0开始(下标) 过了 #include <iostre 阅读全文
posted @ 2020-04-06 17:39 Hazelxcf 阅读(173) 评论(0) 推荐(0)
摘要:https://vjudge.net/problem/POJ-3255 #include <iostream> #include <cstring> #include <queue> #include <vector> using namespace std; typedef pair<int, i 阅读全文
posted @ 2020-04-06 15:51 Hazelxcf 阅读(123) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/P1341 https://blog.csdn.net/STILLxjy/article/details/51956183?depth_1-utm_source=distribute.pc_relevant.none-task&utm 阅读全文
posted @ 2020-02-29 16:07 Hazelxcf 阅读(192) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/P1330 #include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 5; int cnt[2]; int color[maxn]; vector<int> 阅读全文
posted @ 2020-02-28 22:13 Hazelxcf 阅读(89) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/P3386 #include <bits/stdc++.h> using namespace std; const int maxn = 1e3 + 10; int n,m,e,link[maxn][maxn],ans; int us 阅读全文
posted @ 2020-02-28 12:12 Hazelxcf 阅读(141) 评论(0) 推荐(0)
摘要:P3366 【模板】最小生成树 #include <bits/stdc++.h> using namespace std; const int nn = 5010; const int mm = 2e5 + 5; int n,m,fa[nn]; int ans,cnt; struct node{ i 阅读全文
posted @ 2020-02-09 20:34 Hazelxcf 阅读(81) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; const int maxn = 1e5 + 10; vector<int> G[maxn]; int DFN[maxn], LOW[maxn], index, cnt; int ans[maxn], belo 阅读全文
posted @ 2019-08-13 10:53 Hazelxcf 阅读(102) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/P2774 在一个有 m×n 个方格的棋盘中,每个方格中有一个正整数。 现要从方格中取数,使任意2个数所在方格没有公共边,且取出的数的总和最大。试设计一个满足要求的取数算法。 输入格式: 文件第1行有2个正整数 m 和 n,分别表示棋 阅读全文
posted @ 2019-08-01 11:03 Hazelxcf 阅读(110) 评论(0) 推荐(0)
摘要:搭配飞行员 飞行大队有若干个来自各地的驾驶员,专门驾驶一种型号的飞机,这种飞机每架有两个驾驶员,需一个正驾驶员和一个副驾驶员。由于种种原因,例如相互配合的问题,有些驾驶员不能在同一架飞机上飞行,问如何搭配驾驶员才能使出航的飞机最多。 因为驾驶工作分工严格,两个正驾驶员或两个副驾驶员都不能同机飞行。 阅读全文
posted @ 2019-08-01 11:01 Hazelxcf 阅读(108) 评论(0) 推荐(0)
摘要:https://www.luogu.com.cn/problem/P3376 #include<bits/stdc++.h> #define int long long const int INF = 0x3f3f3f3f; const int maxn = 3e5+10; using namesp 阅读全文
posted @ 2019-07-26 15:54 Hazelxcf 阅读(140) 评论(0) 推荐(0)
摘要:https://blog.csdn.net/acdreamers/article/details/16902023 阅读全文
posted @ 2019-07-25 20:39 Hazelxcf 阅读(74) 评论(0) 推荐(0)