不墨迹 #include <iostream> #include <algorithm> using namespace std; const int maxn = 1e6; int a[maxn], b[maxn]; int main() { #ifndef ONLINE_JUDGE freope ...
分类:
其他好文 时间:
2020-06-26 18:16:06
阅读次数:
64
题目 https://www.luogu.com.cn/problem/P1991 分析 本题使用kruskal算法,再能保证所有的节点都能够被连接的情况下,将构成最小生成树的边的长度入队进行排列,除去可以使用卫星电话的节点(就是除去排在前面最长的边)输出最长的边 至于添加边的话,要添加不同节点之间 ...
分类:
其他好文 时间:
2020-06-26 18:10:15
阅读次数:
64
题目传送门 分析: 费用流,然而不会优化,在线膜拜大佬的博客OrzOrzOrz #include<cstdio> #include<cmath> #include<cstring> #include<algorithm> #include<vector> #include<queue> #defin ...
分类:
其他好文 时间:
2020-06-26 16:28:00
阅读次数:
54
7-2 Zigzag Sequence (25分) This time your job is to output a sequence of N positive integers in a zigzag format with width M in non-decreasing order. A ...
分类:
其他好文 时间:
2020-06-26 14:45:16
阅读次数:
81
【题目】 给定一个包含从0、1、2,...,n中获取的n个不同数字的数组,找到该数组中缺少的一个。 Example 1: Input: [3,0,1] Output: 2 Example 2: Input: [9,6,4,2,3,5,7,0,1] Output: 8 Example 3: Input ...
分类:
其他好文 时间:
2020-06-26 13:05:13
阅读次数:
54
题目链接:小猫爬山 解法一: #include<iostream> #include<algorithm> using namespace std; const int N = 20; int n,m; int cat[N],sum[N]; int ans=N; void dfs(int now,i ...
分类:
编程语言 时间:
2020-06-26 10:50:34
阅读次数:
99
#include<cstdio> #include<cstring> #include<algorithm> #include<queue> #include<iostream> using namespace std; const int maxn=200010; const double eps ...
分类:
其他好文 时间:
2020-06-25 19:49:59
阅读次数:
64
1.介绍 排序是将一组数据,以指定的顺序进行排序的过程 2.分类 内部排序法:指将需要处理的所有数据都加载到内部存储器中进行排序 外部排序法:数据量过大,无法全部加载到内存中,需要借助外部存储进行排序 ...
分类:
编程语言 时间:
2020-06-25 15:25:37
阅读次数:
54
1 #include <iostream> 2 #include <vector> 3 #include <algorithm> 4 using namespace std; 5 bool cmp(int a, int b) { 6 return a > b; 7 } 8 int main() { ...
分类:
其他好文 时间:
2020-06-25 09:46:47
阅读次数:
57
Buggy Robot 思路:dp[inx][x][y],表示用了前inx个指令后的最小费用。 对于一个指令,我们可以选择不走或者走,其他的我们可以添加四个方向的指令与使用过指令后的dp来比较。 1 #include <iostream> 2 #include <algorithm> 3 #incl ...
分类:
其他好文 时间:
2020-06-24 16:11:34
阅读次数:
35