06 2012 档案

摘要:Sorting It All OutTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 20350Accepted: 6999DescriptionAn ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, 阅读全文
posted @ 2012-06-18 22:31 w0w0 阅读(174) 评论(0) 推荐(0)
摘要:1.广度优先遍历也是层序遍历void bfs(node *root){ queue<node*> q; q.push(root); while(!q.empty()) { node *n = q.front(); q.pop(); cout<<n->data; if(n->left!=NULL) q.push(n->left); if(n->right!=NULL) q.push(n->right); }}2.深度优先遍历非递归void dfs(nod... 阅读全文
posted @ 2012-06-13 13:49 w0w0 阅读(246) 评论(0) 推荐(0)
摘要:总结了一下常用的排序,可能面试的时候会用到总结了才发现有那么多奇奇怪怪的排序算法,还有的以前都没听说过参考http://www.cnblogs.com/kkun/archive/2011/11/23/2260312.html1.插入排序void insertion(int arr[], int n){ int i, j; for(i=1;i<n;i++) { for(j=0;j<i;j++) { if(arr[j]>arr[i]) break; } int temp =... 阅读全文
posted @ 2012-06-12 18:10 w0w0 阅读(192) 评论(0) 推荐(0)
摘要:1.最大流最基本的Ford-Fulkerson算法:每次迭代中 找出任意增广路径p,并把沿p每条边的流f加上其残留容量EK算法:用广度优先来查找增广路径#include<queue>#include<iostream>using namespace std;const int maxn = 1000;const int INF = INT_MAX;queue<int>q;int map[maxn][maxn],path[maxn],flow[maxn];int n,np,nc,m,s,e;int bfs(){ while(!q.empty())q.pop() 阅读全文
posted @ 2012-06-12 09:29 w0w0 阅读(206) 评论(0) 推荐(0)
摘要:The Windy'sTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 2846Accepted: 1232DescriptionThe Windy's is a world famous toy factory that owns M top-class workshop to make toys. This year the manager receives N orders for toys. The manager knows that every order will take different amo 阅读全文
posted @ 2012-06-11 22:04 w0w0 阅读(488) 评论(0) 推荐(0)
摘要:AntsTime Limit: 5000MSMemory Limit: 65536KTotal Submissions: 2754Accepted: 820Special JudgeDescriptionYoung naturalist Bill studies ants in school. His ants feed on plant-louses that live on apple trees. Each ant colony needs its own apple tree to feed itself.Bill has a map with coordinates of n ant 阅读全文
posted @ 2012-06-11 16:32 w0w0 阅读(287) 评论(0) 推荐(0)
摘要:Going HomeTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 13505Accepted: 6936DescriptionOn a grid map there are n little men and n houses. In each unit time, every little man can move one unit step, either horizontally, or vertically, to an adjacent point. For each little man, you need to p 阅读全文
posted @ 2012-06-11 00:27 w0w0 阅读(194) 评论(0) 推荐(0)
摘要:POJ图论分类POJ 2449 Remmarguts' Date(中等)http://acm.pku.edu.cn/JudgeOnline/problem?id=2449题意:经典问题:K短路解法:dijkstra+A*(rec),方法很多相关:http://acm.pku.edu.cn/JudgeOnline/showcontest?contest_id=1144该题亦放在搜索推荐题中POJ 3013 - Big Christmas Tree(基础)http://acm.pku.edu.cn/JudgeOnline/problem?id=3013题意:最简单最短路,但此题要过,需要较 阅读全文
posted @ 2012-06-07 22:23 w0w0 阅读(153) 评论(0) 推荐(0)
摘要:PIGSTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 11736Accepted: 5184DescriptionMirko works on a pig farm that consists of M locked pig-houses and Mirko can't unlock any pighouse because he doesn't have the keys. Customers come to the farm one after another. Each of them has keys 阅读全文
posted @ 2012-06-07 22:21 w0w0 阅读(193) 评论(0) 推荐(0)
摘要:ChessboardTime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 9946Accepted: 3072DescriptionAlice and Bob often play games on chessboard. One day, Alice draws a board with size M * N. She wants Bob to use a lot of cards with size 1 * 2 to cover the board. However, she thinks it too easy to bob, 阅读全文
posted @ 2012-06-07 16:24 w0w0 阅读(220) 评论(0) 推荐(0)
摘要:Selecting CoursesTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 6741Accepted: 2957DescriptionIt is well known that it is not easy to select courses in the college, for there is usually conflict among the time of the courses. Li Ming is a student who loves study every much, and at the begin 阅读全文
posted @ 2012-06-07 15:25 w0w0 阅读(180) 评论(0) 推荐(0)
摘要:Muddy FieldsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5848Accepted: 2166DescriptionRain has pummeled the cows' field, a rectangular grid of R rows and C columns (1 <= R <= 50, 1 <= C <= 50). While good for the grass, the rain makes some patches of bare earth quite mudd 阅读全文
posted @ 2012-06-07 11:18 w0w0 阅读(199) 评论(0) 推荐(0)
摘要:Sorting SlidesTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 2418Accepted: 907DescriptionProfessor Clumsey is going to give an important talk this afternoon. Unfortunately, he is not a very tidy person and has put all his transparencies on one big heap. Before giving the talk, he has to so 阅读全文
posted @ 2012-06-06 11:04 w0w0 阅读(272) 评论(0) 推荐(0)
摘要:Gopher IITime Limit: 2000MSMemory Limit: 65536KTotal Submissions: 5129Accepted: 2122DescriptionThe gopher family, having averted the canine threat, must face a new predator. The are n gophers and m gopher holes, each at distinct (x, y) coordinates. A hawk arrives and if a gopher does not reach a hol 阅读全文
posted @ 2012-06-05 23:40 w0w0 阅读(253) 评论(0) 推荐(0)
摘要:Antenna PlacementTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 4520Accepted: 2229DescriptionThe Global Aerial Research Centre has been allotted the task of building the fifth generation of mobile phone nets in Sweden. The most striking reason why they got the job, is their discovery of a 阅读全文
posted @ 2012-06-05 21:53 w0w0 阅读(216) 评论(0) 推荐(0)
摘要:AsteroidsTime Limit: 1000MSMemory Limit: 65536KTotal Submissions: 9777Accepted: 5247DescriptionBessie wants to navigate her spaceship through a dangerous asteroid field in the shape of an N x N grid (1 <= N <= 500). The grid contains K asteroids (1 <= K <= 10,000), which are conveniently 阅读全文
posted @ 2012-06-05 20:49 w0w0 阅读(188) 评论(0) 推荐(0)
摘要:Drainage DitchesTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 39519Accepted: 14695DescriptionEvery time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means that the clover is covered by water for awhile and takes quite a long time to regr 阅读全文
posted @ 2012-06-05 10:39 w0w0 阅读(145) 评论(0) 推荐(0)
摘要:Power NetworkTime Limit: 2000MSMemory Limit: 32768KTotal Submissions: 17381Accepted: 9190DescriptionA power network consists of nodes (power stations, consumers and dispatchers) connected by power transport lines. A node u may be supplied with an amount s(u) >= 0 of power, may produce an amount 0 阅读全文
posted @ 2012-06-04 16:25 w0w0 阅读(164) 评论(0) 推荐(0)