码迷,mamicode.com
首页 >  
搜索关键字:graph cut    ( 8632个结果
PAT1021. Deepest Root
A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the...
分类:其他好文   时间:2015-02-27 09:56:06    阅读次数:110
Bash下的实用小脚本(不定期更新)
1、lnoi.sh:列出当前系统下每个IP的连接数:#catlnoi.sh#!/bin/bash #UseforlistconnectnumbersandIPaddress. netstat-n|grep‘^tcp‘|grep-v‘127.0.0.1‘|awk‘{print$5}‘|cut-d:-f1|sort|uniq-c|sort-rn|awk‘BEGIN{printf"%-10s%s\n","ConNum","IP"}{printf"%-11s%s\n",$1,$2}..
分类:其他好文   时间:2015-02-27 01:38:42    阅读次数:208
倒计时javascript性能优化
1.balls数组中的元素个数有增无减,考虑将滚到画面外的小球排出balls数组;function updateBalls(){ ...... var cut = 0; for( var i = 0 ; i 0 && balls[i].x-RADIUScut)//前cut个小球在屏...
分类:编程语言   时间:2015-02-26 21:36:16    阅读次数:195
hdu 4635 强连通分量+缩点
http://acm.hdu.edu.cn/showproblem.php?pid=4635 Problem Description Give a simple directed graph with N nodes and M edges. Please tell me the maximum number of the edges you can add that the gr...
分类:其他好文   时间:2015-02-26 18:35:11    阅读次数:148
133. Clone Graph Leetcode Python
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 each...
分类:编程语言   时间:2015-02-26 11:41:10    阅读次数:181
递归与分治
棋盘覆盖2^k的棋盘格子,有一个缺陷,用L形状的的拼图把棋盘覆盖。每次涂抹的时候先按照缺陷的四周涂抹……23333参考int dir[4][2] = {{0,0},{0,1},{1,0},{1,1}}; ///棋盘L形状对应的分别缺少那个格子int graph[10000][10000];void....
分类:其他好文   时间:2015-02-24 22:12:17    阅读次数:174
hdu 2489 Minimal Ratio Tree DFS枚举点+最小生成树 属于中等偏上题 ,Double比较大小的时候注意精度问题
Problem Description For a tree, which nodes and edges are all weighted, the ratio of it is calculated according to the following equation. Given a complete graph of n nodes with all nodes and edges weighted, your task is to find a tree, which is a sub...
分类:其他好文   时间:2015-02-24 09:09:36    阅读次数:142
PAT 05-1 List Components (简单DFS与BFS)
刚一拿到这道题把他想的太复杂了 明明是长度最大为十的顺序结构就能解决的问题,竟然优先想到用链表。 BFS牵扯到一个队列的操作,在这种小规模数据里面 用顺序结构好很多 题目如下: For a given undirected graph with N vertices and E edges, please list all the connected...
分类:其他好文   时间:2015-02-24 09:09:25    阅读次数:242
hdu 1679 The Unique MST 次小生成树 简单题
Given a connected undirected graph, tell if its minimum spanning tree is unique. Definition 1 (Spanning Tree): Consider a connected, undirected graph G = (V, E). A spanning tree of G is a subgraph of G, say T = (V', E'), with the following properties: 1...
分类:其他好文   时间:2015-02-23 15:33:46    阅读次数:257
POJ2914 Minimum Cut【全局最小割】【Stoer-Wangner】
题目大意: 提一个无向有重边的图,有重边的边权累加起来,求全局最小割。 思路: 一个无向连通图,去掉一个边集可以使其变成两个连通分量则这个边集就是割集。最小割 集当然就是权和最小的割集。 这是一个最简单的全局最小割模板题。直接套上模板就可以了。来说说Stoer-Wangner算 法吧。 Stoer-Wangner算法: 对于图中的任意两个顶点u和v,若u,v属于最小割的同一个集合中,那么僵顶点u和顶点 v合并后并不影响图的最小割。那么,如果能求出图中某两个顶点之间的最小割,更新答案 后合并这两个顶点继续求...
分类:其他好文   时间:2015-02-20 23:12:06    阅读次数:361
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!