码迷,mamicode.com
首页 >  
搜索关键字:clustering algorithm    ( 12082个结果
CF521D Shop 贪心
比较好的一道贪心题. code: #include <set> #include <vector> #include <cstdio> #include <cstring> #include <algorithm> #define N 100009 #define ll long long #def ...
分类:其他好文   时间:2020-07-11 12:50:00    阅读次数:60
key-value结构排序:给定一个字符串,统计每个字符出现频率,先按value降序,再按key升序
对于key-value结构的排序第一种:lambda表达式第二种:函数第三种:类对()的重载,仿函数形式#include<iostream>#include<vector>#include<unordered_map>#include<string>#include<algorithm>usingnamespacestd;boolcmp(
分类:编程语言   时间:2020-07-11 11:13:38    阅读次数:112
拓扑排序,bitset~[JSOI2015]最小表示
拓扑排序,bitset~[JSOI2015]最小表示 传送门 题意:在有向无环图中删尽可能多的边,使图连通性不变,输出最大数量。 题解:写这题主要就是学一下bitset的用法,首先如果一个x到y的边可以删的话,说明从x到y有别的路可以走,从此还可以想到解此题的一个关键,如y可以到z,然后x连着y与z ...
分类:编程语言   时间:2020-07-11 09:14:51    阅读次数:47
CodeForces 572C. Lengthening Sticks(不定方程的根的方案个数)
题意:给你三条边$x,y,z$,你可以给三条边各自增加任意数值,但是增加的总和最多为$w$。求可以组成三角形的方案数。 分析:设$x y z$的增量为p1,p2,p3,假定$p1 + p2 + p3 = t,t\in{[0, w]}$,题目中要求的增量可以为0,如果按平常来说,对于形如$p1 + p ...
分类:其他好文   时间:2020-07-10 21:24:43    阅读次数:47
Meeting
2020-07-06 个人赛1 E:Meetings 题面: 样例: #include <iostream> #include <algorithm> #include <cstdio> #include <cstring> #include <map> #include <queue> #incl ...
分类:其他好文   时间:2020-07-10 21:23:25    阅读次数:86
「模板」负环 spfa禁忌
题目链接: 「模板」负环 解释 不要deque,否则会出错,就是可能会都判为有负环 用queue是正常的 自己的出错数据 正确答案为:NO(应该是无负环) Code #include <cstdio> #include <cstring> #include <algorithm> #include ...
分类:其他好文   时间:2020-07-10 21:11:28    阅读次数:65
Leslie Lamport在其一篇影响深远的论文《Time,Clocks and the Ordering of Events in a Distributed System》
《Time,Clocks and the Ordering of Events in a Distributed System》 绕不开的Leslie Lamport 数学【数学是皇帝,物理是皇后】。【宗教:万佛朝宗】 归纳,类比,演绎,反证。 第一性原理。数学,物理,宗教。。。 etcd is w ...
分类:其他好文   时间:2020-07-10 16:58:29    阅读次数:72
A - Coloring Roads Gym - 102059A
用lct中的access操作来维护链。因为每一次更新到根节点所以不用split操作。 注意下传标记和统计的时候影响。 #include<iostream> #include<cstring> #include<algorithm> #include<cmath> #include<cstdlib> ...
分类:其他好文   时间:2020-07-10 15:32:17    阅读次数:70
Silver Cow Party题解
Silver Cow Party Description One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1..N is going to attend the big cow party to be held at ...
分类:其他好文   时间:2020-07-10 13:33:46    阅读次数:81
求最近公共祖先LCA两种方法
Tarjan求Lca 倍增求Lca tarjan求lca 这种算法本质上是用并查集对向上标记法的优化,是离线算法,即一次性读入所有询问,统一计算,统一输出。 时间复杂度$O(n+m)$ v[]进行标记 \(v[x]\doteq 0\) --> x节点未访问过 \(v[x]\doteq 1\) --> ...
分类:其他好文   时间:2020-07-10 10:03:22    阅读次数:80
12082条   上一页 1 ... 29 30 31 32 33 ... 1209 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!