随笔分类 -  POJ

题解and代码
POJ1159
摘要:题目内容PalindromeTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 39600 Accepted: 13434DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determine... 阅读全文

posted @ 2011-11-05 17:27 SilVeRyELF 阅读(134) 评论(0) 推荐(0)

POJ 3176 Cow Bowling
摘要:题目内容Cow BowlingTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 9341 Accepted: 6158DescriptionThe cows don't use actual bowling balls when they go bowling. They each take a number (in the range 0..99), though, and line up in a standard bowling-pin-like triangle like this: ... 阅读全文

posted @ 2011-11-04 20:57 SilVeRyELF 阅读(174) 评论(0) 推荐(0)

POJ 2533 Longest Ordered Subsequence
摘要:题目内容Longest Ordered SubsequenceTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 20761 Accepted: 8973DescriptionA numeric sequence of ai is ordered if a1 < a2 < ... < aN. Let the subsequence of the given numeric sequence (a1, a2, ..., aN) be any sequence (ai1, ai2, ..., aiK), w... 阅读全文

posted @ 2011-11-04 20:38 SilVeRyELF 阅读(208) 评论(0) 推荐(0)

POJ 1260 珍珠
摘要:题目内容PearlsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 4937 Accepted: 2383DescriptionIn Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls in it. The Royal Pearl has its name because it delivers to the royal fa... 阅读全文

posted @ 2011-11-04 19:28 SilVeRyELF 阅读(133) 评论(0) 推荐(0)

POJ 1836 Alignment 士兵队列
摘要:题目内容AlignmentTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 7320 Accepted: 2319DescriptionIn the army, a platoon is composed by n soldiers. During the morning inspection, the soldiers are aligned in a straight line in front of the captain. The captain is not satisfied with t... 阅读全文

posted @ 2011-11-03 21:04 SilVeRyELF 阅读(510) 评论(0) 推荐(1)

POJ2676 Soduku数独
摘要:题目内容SudokuTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 9343 Accepted: 4626 Special JudgeDescriptionSudoku is a very simple task. A square table with 9 rows and 9 columns is divided to 9 smaller squares 3x3 as shown on the Figure. In some of the cells are written dec... 阅读全文

posted @ 2011-10-31 21:13 SilVeRyELF 阅读(230) 评论(0) 推荐(0)

POJ2531 Network Saboteur
摘要:题目内容Network SaboteurTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6562 Accepted: 2844DescriptionA university network is composed of N computers. System administrators gathered information on the traffic between nodes, and carefully divided the network into two subnetworks i... 阅读全文

posted @ 2011-10-31 18:12 SilVeRyELF 阅读(369) 评论(0) 推荐(0)

POJ3414 Pots倒水问题
摘要:题目内容PotsTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 5822 Accepted: 2451 Special JudgeDescriptionYou are given two pots, having the volume of A and B liters respectively. The following operations can be performed: 1. FILL(i) fill the pot i (1 ≤ i ≤ 2) from ... 阅读全文

posted @ 2011-10-30 21:15 SilVeRyELF 阅读(395) 评论(0) 推荐(0)

POJ3126 素数之路
摘要:题目内容Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 6432 Accepted: 3673DescriptionThe ministers of the cabinet were quite upset by the message from the Chief of Security stating that they would all have to change the four-digit room numbers on their offices.— It is ... 阅读全文

posted @ 2011-10-30 18:50 SilVeRyELF 阅读(262) 评论(0) 推荐(0)

POJ3278 BFS
摘要:题目内容Catch That CowTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 26330 Accepted: 8122DescriptionFarmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a p... 阅读全文

posted @ 2011-10-30 15:41 SilVeRyELF 阅读(247) 评论(0) 推荐(0)

POJ2251 地下城主3维迷宫
摘要:题目内容 Dungeon MasterTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 10134 Accepted: 3908DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to mov... 阅读全文

posted @ 2011-10-30 09:22 SilVeRyELF 阅读(173) 评论(0) 推荐(0)

POJ1321 搜索题解
摘要:棋盘问题Time Limit: 1000MS Memory Limit: 10000KTotal Submissions: 12845 Accepted: 6344Description在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <= n当为-1 -1时表示输入结 阅读全文

posted @ 2011-10-29 21:02 SilVeRyELF 阅读(155) 评论(0) 推荐(0)

新!POJ训练计划
摘要:初级:基本算法:枚举:1753 2965贪心:1328 2109 2586构造:3295模拟:1068 2632 1573 2993 2996图:最短路径:1860 3259 1062 2253 1125 2240最小生成树:1789 2485 1258 3026拓扑排序:1094二分图的最大匹配:3041 3020最大流的增广路算法:1459 3436数据结构:串:1035 3080 1936排序:2388 2299哈希表和二分查找等高效查找法:3349 3274 2151 1840 2002 2503哈夫曼树:3253树:2513简单搜索:深度优先搜索:2488 3083 3009 132 阅读全文

posted @ 2011-10-29 16:58 SilVeRyELF 阅读(1797) 评论(0) 推荐(2)

POJ3009 DFS解
摘要:Curling 2.0Time Limit: 1000MSMemory Limit: 65536KTotal Submissions: 5792Accepted: 2381DescriptionOn Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewhat different from ours. The game is played on an ice game board on which a square mesh is marked. 阅读全文

posted @ 2011-10-28 21:39 SilVeRyELF 阅读(174) 评论(0) 推荐(0)

POJ题目分类
摘要:初级:基本算法:枚举:1753 2965贪心:1328 2109 2586构造:3295模拟:1068 2632 1573 2993 2996图:最短路径:1860 3259 1062 2253 1125 2240最小生成树:1789 2485 1258 3026拓扑排序:1094二分图的最大匹配:3041 3020最大流的增广路算法:1459 3436数据结构:串:1035 3080 1936排序:2388 2299哈希表和二分查找等高效查找法:3349 3274 2151 1840 2002 2503哈夫曼树:3253树:2513简单搜索:深度优先搜索:2488 3083 3009 132 阅读全文

posted @ 2011-10-14 20:26 SilVeRyELF 阅读(1593) 评论(0) 推荐(0)

POJ1013
摘要:悲剧了,这道题自己本来会的,小细节处理错误导致WA好几次,最后还是看了下别人的程序,真的无语。思路很简单:如果天平平衡(even),则两边的coin都是真的。如果不平衡,则针对每一枚coin增加或减少其对应的怀疑值。最后的目标就是那个怀疑值最大的假币!C++代码如下: 1 #include<iostream> 2 #include<cstring> 3 #include<string> 4 using namespace std; 5 long abs(long x) 6 { 7 if(x<0)return -x; 8 return x; 9 }10 阅读全文

posted @ 2011-10-14 09:00 SilVeRyELF 阅读(367) 评论(0) 推荐(1)

导航