名称: 策略模式(Strategy Pattern) 问题: The intent of the Strategy Pattern is to define a family of algorithms, encapsulate each algorithm, and make them inter ...
分类:
其他好文 时间:
2020-06-28 20:11:35
阅读次数:
55
link referenct to @617280219 Sort and group edges by weight. In each step we process one group of edges Discard the edges whose ends are already conne ...
分类:
其他好文 时间:
2020-06-28 09:37:19
阅读次数:
70
题目传送门 #Code #include<iostream> #include<cstdio> #include<string> #include<vector> #include<algorithm> #include<cstdlib> #include<cmath> #include<stack ...
分类:
其他好文 时间:
2020-06-27 20:05:01
阅读次数:
54
题目 https://www.luogu.com.cn/problem/P4715 分析 这道题我是使用了动态规划思想的数塔的做法,从数塔底层开始比较,一层一层网上找,找到第二层在比较找出亚军(数组的最低维来表示index与国家的能力值) 但是最简单的思路:么的把 n 支队伍分成两个区间,一个上半区 ...
分类:
其他好文 时间:
2020-06-27 13:23:27
阅读次数:
67
参考文献 An overview of gradient descent optimization algorithms 梯度下降 GD(Gradient Descent) 梯度方向是函数变化率最大的方向,是函数增长最快的方向。 梯度的反方向是函数减少的最快方向。 ex: 从山上走到谷底 \(x_j ...
分类:
编程语言 时间:
2020-06-27 09:53:45
阅读次数:
125
不墨迹 #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