觉得浮夸了四年,漠然发现原来是浮躁了四年!

03 2013 档案

摘要:最近在研究二分图问题,有很多东东还是不熟悉!边学习边完善!【二分图】图中的顶点可以分为两个不相交的点集u和v,因此,二分图中的每个边都是u中的一个点连接v中的一个点。因为u与v不相交,所以图中不存在环。【二分图的匹配】给定一个二分图G,M为G边集的一个子集,如果M满足当中的任意两条边都不依附于同一个顶点,则称M是一个匹配。【二分图的最大匹配】包含边数最多的匹配就是最大匹配。(比如,一个二分图中有三个匹配,即经过求最大匹配算法计算后有三个匹配,那么这个二分图的最大匹配数就是3)【匈牙利算法】计算最大匹配的一种算法:算法的理论基础:一个匹配为最大匹配当且仅当匹配中不存在交错路。(所以二分图的求解过 阅读全文
posted @ 2013-03-26 15:27 heat nan 阅读(1371) 评论(0) 推荐(0) 编辑
摘要:最下生成树题目汇集:POJ 2845 Highways http://poj.org/problem?id=2485最小生成树(并查集解)胚胎级题目:还行没忘完,还算顺利:注意结构体的s开的范围要大于N*N/2;(Runtime error)用algorithm 的头文件时,不要用max作变量名称;(CE)View Code 1 #include<iostream> 2 #include<algorithm> 3 #include<cstring> 4 #include<cstdio> 5 using namespace std; 6 #defi 阅读全文
posted @ 2013-03-20 18:44 heat nan 阅读(220) 评论(0) 推荐(0) 编辑
摘要:学习Floyd算法中。。。。。。Floyd : 计算任意两节点间的最短距离,三重循环,效率较低!POJ 1125 Stockbroker Grapevine http://poj.org/problem?id=1125问题简述:一群股票经理人传递虚假消息,问从哪个人那里发出消息,可以使大家在最短的时间内都收到消息!解法:先用floyd算法计算出每两个人之间传递消息的最短时间,然后,对每个人进行遍历,找出时间最短的哪个人!问题的关键就是第i个人传递消息使所有人都能接受的时间,注意这个时间就是i个人发出消息,到最后一个人接受到消息的时间,不存在累加问题,这里我就陷入最短路的思维定... 阅读全文
posted @ 2013-03-20 12:11 heat nan 阅读(358) 评论(0) 推荐(0) 编辑
摘要:POJ 最短路问题集锦:Dijkstra算法:详细介绍:http://hi.baidu.com/iotbill/item/cb5fc1de28a3e63721e250d9Dijkstra算法是典型最短路算法,用于计算一个节点到其他所有节点的最短路径。主要特点是以起始点为中心向外层层扩展,直到扩展到终点为止。Dijkstra算法能得出最短路径的最优解,但由于它遍历计算的节点很多,所以效率低。POJ 2387Til the Cows Come Home (problem link adress:http://poj.org/problem?id=2387)虽然题目不是很好读,但本题是Dijkst. 阅读全文
posted @ 2013-03-18 20:19 heat nan 阅读(3731) 评论(1) 推荐(0) 编辑
摘要:Disjoint-set namely Union-Find set!hdu 3172virtual friends http://acm.hdu.edu.cn/showproblem.php?pid=3172Yes! A very interesting problem!Whenever a friendship is formed,printfthe number of the peoplein the social network.OK, I failed lots of time. And all are "Time Limit Exceeded".But to m 阅读全文
posted @ 2013-03-17 12:04 heat nan 阅读(198) 评论(0) 推荐(0) 编辑
摘要:Now, this article is for hdu dp problems! Come on !hdu 2391 Filthy Rich Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=2391This problem is silimar to one of the problem in the province contest,so cleared it successfully!In a world, it's a good problem!View Code 1 #include<iostr 阅读全文
posted @ 2013-03-16 19:33 heat nan 阅读(251) 评论(0) 推荐(0) 编辑
摘要:hdu 2425 Hiking Trip Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=2425A simple bfs problem!Notice: If " There is a blank line after each test case." appeared in the INPUT format, we needn't output one blank more after each test case;View Code 1 #include<iostream> 阅读全文
posted @ 2013-03-15 12:24 heat nan 阅读(225) 评论(0) 推荐(0) 编辑
摘要:Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=1241These days I have encountered some problems when I was doing the searching problems;May those problem need to use the DFS algorithm! So I started to learning the DFS:Lots of friends saysthis probelm is a simple DFS problem, so I have 阅读全文
posted @ 2013-03-13 11:20 heat nan 阅读(166) 评论(0) 推荐(0) 编辑
摘要:A. Theatre Squaretime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputTheatre Square in the capital city of Berland has a rectangular shape with the size n × m meters. On the occasion of the city's anniversary, a decision was taken to pave the 阅读全文
posted @ 2013-03-10 14:23 heat nan 阅读(2736) 评论(0) 推荐(0) 编辑
摘要:07年 Excel排序 http://acm.hdu.edu.cn/showproblem.php?pid=1862想放松下,就来做做浙大的复试题,考的都是蛮基础的,可是各种陷阱有没有,接着就连着wa了N次,被虐有木有?这题完全基本函数的应用,需熟悉sort、strcmp等函数和结构体,就ok了。可是一定要看清啊! 当若干学生具有相同姓名或者相同成绩时,则按他们的学号递增排序。还有按姓名的非递减序列排序,不是需要比个姓名的首个字符就可以的。View Code 1 #include<iostream> 2 #include<iomanip> 3 #include<a 阅读全文
posted @ 2013-03-06 17:24 heat nan 阅读(240) 评论(0) 推荐(0) 编辑
摘要:第三届:C:网络的可靠性 http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=170这题虽然WA了几次,但还是很高兴的毕竟是完全是自己开发的。‘嘎嘎’这题感觉比较实在,接近实际问题不错。做的时候分析一些实例,然后得出结论就OK了。Key: 分析几个问题后,会发现当一个基站的连接的光纤数为三时,就要注意这个基站了,总的来说这个规律不算难找。View Code 1 2 #include<iostream> 3 #include<cstring> 4 #include<cstdio> 5 using namesp 阅读全文
posted @ 2013-03-04 12:48 heat nan 阅读(243) 评论(0) 推荐(0) 编辑
摘要:problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=1878欧拉回路的判定:并查集(Disjoint set)去年暑假学习的,唉我这个败家子到现在忘得差不多了,看以前的blog才恢复的功力。。。。。。。囧,欧拉回路的判定,还是参考别人的思路,好吧!。。。。。。。。。。判定条件:1 每个节点数必须是22 判断是否构成了回路,可用并查集来判断,也就是所有点在一个集合里Run IDSubmit TimeJudge StatusPro.IDExe.TimeExe.MemoryCode Len.Language76805092013 阅读全文
posted @ 2013-03-03 11:51 heat nan 阅读(317) 评论(0) 推荐(0) 编辑
摘要:Problem link adress:http://acm.hdu.edu.cn/showproblem.php?pid=2645//*****analysis*****//The meaning of the problem is simple.In the map consist of '0' and '1',find the nearest '1' for every '0'.Clearly, we should use bfs work out every nearest station.Is it brute forc 阅读全文
posted @ 2013-03-02 23:17 heat nan 阅读(236) 评论(0) 推荐(0) 编辑
摘要:Problem Link adress:http://acm.hdu.edu.cn/showproblem.php?pid=1171Problem analysis:本题可以转换为多重背包问题。DP算法的最大特点就是计算最优解。题目大意:计算机学院要分成计算机学院和软件学院,即这两个新的学院要“分家”,要求尽可能的公平,即两家学院分的的财产尽可能的接近,如果实在无法保证相等的话,计算机学院分的的财产不能少于软件学院的。可以以财产的总和的一半为背包,求的背包最大值。因为每件物品可以有很多件,所以本题为多重背包问题,可以把多重背包转化为01背包来解决。#include<iostream> 阅读全文
posted @ 2013-03-02 19:46 heat nan 编辑
摘要:B. Taxitime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAfter the lessons n groups of schoolchildren went outside and decided to visit Polycarpus to celebrate his birthday. We know that the i-th group consists of si friends (1 ≤ si ≤ 4), and they 阅读全文
posted @ 2013-03-02 12:19 heat nan 阅读(259) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示