c++之map排序 为了实现查找,map在插值时已经对 key值 进行了排序(使用红黑树结构)。如果想对map的 value值 进行排序,由于 只可以对 进行排序,那么可以将map转为vector后进行排序。 include include include // 对map不能直接排序, 使用vect ...
分类:
编程语言 时间:
2019-02-25 21:46:46
阅读次数:
260
Description A pair of numbers has a unique LCM but a single number can be the LCM of more than one possible pairs. For example 12 is the LCM of (1, 12 ...
分类:
其他好文 时间:
2019-02-23 01:11:16
阅读次数:
157
"传送门" D. Destroy the Colony 首先明确题意:除了规定的两种(或一种)字母要在同侧以外,其他字母也必须在同侧。 发现当每种字母在左/右边确定之后,方案数就确定了,就是分组的方案数乘$\frac{((n/2)!)^2}{\prod cnt_i!}$。 分组的方案数考虑DP,设$ ...
分类:
其他好文 时间:
2019-02-22 21:18:56
阅读次数:
132
输入两个整数G、L,求两个数a、b使得其最大公因数和最小公倍数分别为G、L。 ...
分类:
其他好文 时间:
2019-02-22 19:47:54
阅读次数:
218
vue 中 href img/src 的使用方法: {{repairList.productName}} ...
分类:
其他好文 时间:
2019-02-22 12:26:10
阅读次数:
146
题目描述: 由于 zzq 太懒了,所以这题没有题目背景。 有一棵树,树上有 n 个点,每条边上有一个非负边权。 在这 n 个点中有 k 个特殊点,其中 k 为偶数。定义两个点的距离为它们在树上的简单路径上的边权之和。你需要将这 k 个点配成k/2个互不相交的对,并最大化每一对点的距离之和。 思路: ...
分类:
其他好文 时间:
2019-02-22 01:06:30
阅读次数:
238
正则表达式 1、符号分类: 2、运算优先级: 3、实例: 全部符号解释: http://www.cnblogs.com/yirlin/archive/2006/04/12/373222.html 1、符号分类: 2、运算优先级: 3、实例: 1.正则表达式基本语法 两个特殊的符号 ' ^ ' 和 ' ...
分类:
其他好文 时间:
2019-02-18 12:49:47
阅读次数:
211
Given a set of distinct positive integers, find the largest subset such that every pair (Si, Sj) of elements in this subset satisfies: Si % Sj = 0 or ...
分类:
其他好文 时间:
2019-02-16 23:13:33
阅读次数:
297
"Luogu 2742 二维凸包" 使用 $Andrew$ 算法.将点排序后分别求上下凸壳,用单调栈维护. 利用向量叉积来判断当前方向.若 $v_1\times v_2 using namespace std; define ll long long define mp make_pair defi ...
分类:
其他好文 时间:
2019-02-16 19:30:09
阅读次数:
220
题意: 思路:来自:https://blog.csdn.net/guozlh/article/details/53209339利用map<pair<char,int>,int>模拟数组,map<char,int>用于存放定义数组的长度定义语句不用考虑,直接模拟存放其长度即可赋值语句要分别计算等号左边 ...
分类:
其他好文 时间:
2019-02-16 18:22:16
阅读次数:
202