文本过滤之IP地址精准过滤在写之前自己整理了一点自己平时老是搞混的东西,最基础的就不写了,前面的东西不想看得一眼代过,就当借着做IP过滤顺便整理下常用的,看看后面如何精准锁定IP地址吧。一、正则表达式(PATRERN)括号()方括号[]尖括号<>大括号{}的使用\[\]匹配指..
分类:
编程语言 时间:
2015-08-01 19:12:08
阅读次数:
254
题目:
Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.
OJ's undirected graph serialization:
Nodes are labeled uniquely.
We use # as a separator for...
分类:
编程语言 时间:
2015-08-01 19:06:59
阅读次数:
150
题目链接
题意:给你n个数,求一个最长子序列,要求是这个子序列中任意两个数,其中一个一定是另外一个的倍数
代码如下:
#include
#include
#include
#include
const int N = 1E6+10;
using namespace std;
int dp[N], a;
int main()
{
int n, maxn;
while...
分类:
其他好文 时间:
2015-08-01 17:26:05
阅读次数:
137
Soda has a bipartite graph withnvertices andmundirected edges. Now he wants to make the graph become a complete bipartite graph with most edges by add...
分类:
其他好文 时间:
2015-08-01 17:12:16
阅读次数:
107
内容目录:find 文件查找grep 文本搜索xargs 命令行参数转换sort 排序uniq 消除重复行用tr进行转换cut 按列切分文本paste 按列拼接文本wc 统计行和字符的工具sed 文本替换利器awk 数据流处理工具迭代文件中的行、单词和字符本文将介绍Linux下使用Shell处理文本...
分类:
系统相关 时间:
2015-08-01 17:06:57
阅读次数:
264
题目大意:给出每个点之间的最短距离,问需要几条边才能形成这张图解题思路:100个点,果断floyd,接着判断
如果dp[i][j] > dp[i][k] + dp[k][j]表示这张图构建不了,因为最短路冲突了
如果dp[i][j] == dp[i][k] + dp[k][j],就表示ij这条路可以被ik和kj取代,那么这条路就可去掉了
去掉的路记得标记。。。WA了好多次#include <c...
分类:
其他好文 时间:
2015-08-01 01:06:44
阅读次数:
121
DescriptionGiven a graph (V,E) where V is a set of nodes and E is a set of arcs in VxV, and anorderingon the elements in V, then thebandwidthof a node...
分类:
其他好文 时间:
2015-07-31 20:07:23
阅读次数:
154
F. Clique in the Divisibility Graph题目传送:Clique in the Divisibility Graph解法:筛法+DPAC代码:#include
#include
#include
#include
#include
#include
#include ...
分类:
其他好文 时间:
2015-07-31 10:38:06
阅读次数:
112
4.2 Given a directed graph, design an algorithm to find out whether there is a route between two nodes.LeetCode和CareerCup中关于图的题都不是很多,LeetCode中只有三道,分别是...
分类:
其他好文 时间:
2015-07-31 01:12:47
阅读次数:
199
按边权从大到小加边,用Link-Cut Tree维护最小生成树。对于当前要加的边i,最小生成树上边权在[1,R]范围内的和就是询问[e[i].w,R]的答案。因为强制在线,所以用主席树存下所有历史版本即可。时间复杂度$O(n\log n)$。#include#includeusing namespa...
分类:
其他好文 时间:
2015-07-30 22:45:42
阅读次数:
213