随笔分类 - ACM / 图论
摘要:https://vjudge.net/problem/POJ-3723 n个女的,m个男的,选择一个战士需要花费10000,如果有亲密关系,需要花费10000-d; 花费最小 用了cin加了优化超时了,后来改了scanf之后答案错误 后来把e等从0开始(下标) 过了 #include <iostre
阅读全文
摘要:https://vjudge.net/problem/POJ-3255 #include <iostream> #include <cstring> #include <queue> #include <vector> using namespace std; typedef pair<int, i
阅读全文
摘要: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
阅读全文
摘要: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>
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:#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
阅读全文
摘要:https://www.luogu.com.cn/problem/P2774 在一个有 m×n 个方格的棋盘中,每个方格中有一个正整数。 现要从方格中取数,使任意2个数所在方格没有公共边,且取出的数的总和最大。试设计一个满足要求的取数算法。 输入格式: 文件第1行有2个正整数 m 和 n,分别表示棋
阅读全文
摘要:搭配飞行员 飞行大队有若干个来自各地的驾驶员,专门驾驶一种型号的飞机,这种飞机每架有两个驾驶员,需一个正驾驶员和一个副驾驶员。由于种种原因,例如相互配合的问题,有些驾驶员不能在同一架飞机上飞行,问如何搭配驾驶员才能使出航的飞机最多。 因为驾驶工作分工严格,两个正驾驶员或两个副驾驶员都不能同机飞行。
阅读全文
摘要: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
阅读全文
摘要:https://blog.csdn.net/acdreamers/article/details/16902023
阅读全文

浙公网安备 33010602011771号