- 博客(21)
- 资源 (9)
- 收藏
- 关注
原创 POJ 2084 Game of Connections
Game of ConnectionsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 4839 Accepted: 2515DescriptionThis is a small but ancient game. You are supposed to
2009-12-31 20:16:00 2286 2
原创 POJ 2085 Inversion
InversionTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 2631 Accepted: 1143DescriptionThe inversion number of an integer sequence a1, a2, . . . , an i
2009-12-30 22:56:00 1167 1
原创 POJ 2049 Finding Nemo
/*做完这题我打算看《海底总动员》Demo Demo好可爱用广搜过的, 主要思路如下:(1)首先是建图, 由于输入给的都是线段, 但是我们平常处理这类问题都是转换为网格来做的, 因此需要将线段转换为网格.转化的方法是对于每个格子,用其左上角点的坐标来表示这个格子,如果其左上角点的坐标是[i][j],那么这个格子就表示为[i][j].将其四周边界的四条线段归这个格子管.即为每个格
2009-12-28 20:03:00 3181 1
原创 POJ 2046 Gap
/*BFS,利用set来判重.将状态封装到string大大简化了处理过程*/#include #include #include #include using namespace std;set hashSets;struct elem{ int steps; string state;};queue bfsq;
2009-12-26 18:51:00 1369
原创 POJ 2044 Weather Forecast
/*深度优先搜索,需要记忆状态,状态的记忆包括四个角到目前为止没有下雨的时间+云当前所在的位置+当前的天数,一开始写错了一个地方害我调了N久,最近为啥没状态*/#include #define MAX_N 370#define MAX_S 80000using namespace std;struct day{ int state;}day
2009-12-26 14:57:00 1186
原创 POJ 2036 I Conduit!
I Conduit!Time Limit: 2000MS Memory Limit: 30000KTotal Submissions: 1313 Accepted: 245DescriptionIrv Kenneth Diggit works for a company that excavates trenches
2009-12-20 15:27:00 1173
原创 POJ 2030 The Secret Number
The Secret NumberTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1704 Accepted: 564DescriptionYour job is to find out the secret number hidden in a mat
2009-12-19 16:19:00 1222
原创 POJ 2019 Cornfields
CornfieldsTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 3096 Accepted: 1459DescriptionFJ has decided to grow his own corn hybrid in order to help the
2009-12-18 19:23:00 1039
原创 李开复:算法的力量
算法是计算机科学领域最重要的基石之一,但却受到了国内一些程序员的冷落。许多学生看到一些公司在招聘时要求的编程语言五花八门就产生了一种误解,认为学计算机就是学各种编程语言,或者认为,学习最新的语言、技术、标准就是最好的铺路方法。其实大家都被这些公司误导了。编程语言虽然该学,但是学习计算机算法和理论更重要,因为计算机算法和理论更重要,因为计算机语言和开发平台日新月异,但万变不离其宗的是那些算法
2009-12-18 17:16:00 538
原创 POJ 2010 Moo University - Financial Aid
/*要看清楚题是求N个所选Cal中Score中最大的中位数.那么很容易想到将N以中间的分数折半分别求其两边具有最小的aid和的N/2个cal.(1)所以首先可以对输入按照分数进行排序,然后利用堆处理.(2)先让前N/2个cal进堆并统计aid的总和curtotalaid,然后依次对第N/2 ~ C - N/2个cal进行处理.每处理一个cal时,将curtotalaid存入
2009-12-16 18:50:00 1203
原创 POJ 2003 Hire and Fire
Hire and FireTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1304 Accepted: 343DescriptionIn this problem, you are asked to keep track of the hierarchical
2009-12-13 16:14:00 1813
原创 POJ 1930 Dead Fraction
Dead FractionTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1198 Accepted: 354DescriptionMike is frantically scrambling to finish his thesis at the la
2009-12-12 15:30:00 1882
原创 POJ 1932 XYZZY
/*在用BELLMAN时,当考虑某个点i时,如果当前从1到i的当前最大距离是负值,则这个点必须跳出来不能处理。因为此时这个点并不是活着的点,所以不能处理以它为起点的边。如果不这样做可能会存在的错误CASE如下所示:1->2->3->4 ^ | 6 即:如果3,4,5可以构成一个正权环,但是2点的生命值为-1000,那么当游戏者从1走
2009-12-12 10:08:00 977
原创 POJ 1934 Trip LCA及其所有不重复的串
TripTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 1629 Accepted: 372DescriptionAlice and Bob want to go on holiday. Each of them has planned a route,
2009-12-10 22:51:00 1852 2
原创 POJ 1946 Cow Cycling
Cow CyclingTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 1479 Accepted: 788<p class="pst">Description The cow bicycling team consists of N
2009-12-09 20:17:00 877
原创 POJ 1952 BUY LOW BUY LOWER 【DP】最长降序子序列及其计数问题
BUY LOW, BUY LOWERTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 4981 Accepted: 1663DescriptionThe advice to "buy low" is half the formula to success
2009-12-07 13:32:00 2174
原创 POJ 1964 & 1494
City GameTime Limit: 3000MS Memory Limit: 30000KTotal Submissions: 3095 Accepted: 1181DescriptionBob is a strategy game programming specialist. In his new city b
2009-12-06 12:58:00 1138
原创 POJ 1977 Odd Loving Bakers
Odd Loving BakersTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 1372 Accepted: 429DescriptionThere is a group of N bakers in the town of Utopia. These ba
2009-12-05 11:34:00 884
原创 点连通度 边连通度 最大流最小割 最小割点集 最小割边集 & POJ 1966 Cable TV Network
Normal 0 7.8 磅 0 2 false false false MicrosoftInternetExplorer4 <!-- /* Sty
2009-12-05 11:27:00 4390
原创 POJ 1986 Distance Queries
/*由于输入图是一个树,所以可以任意指定一个节点为root结点,然后用LCATarjan算法离线计算任意被查询两个点的LCA,则:dist(i, j) = dist(root, i) + dist(root, j) - 2 * dist(root, lca(i, j))寻找LCA的Tarjan算法,LCATarjan算法是一个离线算法,即所有查找请求是一次性同时处理的,而不是输入一
2009-12-02 13:32:00 1192
原创 POJ 1984 Navigation Nightmare
/*并查集的高级应用,利用并查集计算农场间的相对坐标关系在每次查找和合并的时候由于参照点的变化需要更新相应点的坐标*/#include #include #define MAX_F 40005#define MAX_Q 10005//存储所有农场的位置struct farm{ //并查集的参照点id以及当前点的排名 int sid
2009-12-01 19:33:00 1108
C++实现的大数运算工具 v1.1
2009-08-06
C++实现的大数运算工具 v1.0
2009-06-24
JAVA下基于邻接表的图的通用算法实现
2009-04-15
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人