随笔分类 - POJ
http://poj.org/
摘要:题目:http://poj.org/problem?id=3714http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27048#problem/DRaidTime Limit:5000MSMemory Limit:65536KTotal Submissions:7355Accepted:2185DescriptionAfter successive failures in the battles against the Union, the Empire retreated to its last stronghold. Dependi
阅读全文
摘要:链接:http://poj.org/problem?id=2586http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26733#problem/CY2K Accounting BugTime Limit:1000MSMemory Limit:65536KTotal Submissions:8472Accepted:4185DescriptionAccounting for Computer Machinists (ACM) has sufferred from the Y2K bug and lost some vital data f
阅读全文
摘要:题目:http://poj.org/problem?id=2965来源:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=26732#problem/B题意:就是把题目中给出的状态图,全部翻转成----------------状态翻转: 每次翻转一个,那么它所在的行和列都要翻转问最小翻转次数,同时输出翻转路径.算法:暴力 + 枚举 + dfs思路:可以证明每个把手要么翻转,要么不翻转,那么从左到右,从上到下依次枚举每个把手,同时深搜一遍即可。和前面的棋盘翻转一样.[POJ 1753 Flip Game] 做了棋盘翻转都纠结了半天才出了这
阅读全文
摘要:求高精度幂Time Limit:500MSMemory Limit:10000KTotal Submissions:117394Accepted:28569Description对数值很大、精度很高的数进行高精度计算是一类十分常见的问题。比如,对国债进行计算就是属于这类问题。现在要你解决的问题是:对一个实数R( 0.0 < R < 99.999 ),要求写程序精确计算 R 的 n 次方(Rn),其中n 是整数并且 0 < n <= 25。InputT输入包括多组 R 和 n。 R 的值占第 1 到第 6 列,n 的值占第 8 和第 9 列。Output对于每组输入,要求
阅读全文
摘要:Integer InquiryTime Limit:1000MSMemory Limit:10000KTotal Submissions:26642Accepted:10325DescriptionOne of the first users of BIT's new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers.``This superco
阅读全文
摘要:Basic remainsTime Limit:1000MSMemory Limit:65536KTotal Submissions:4429Accepted:1869DescriptionGiven a base b and two non-negative base b integers p and m, compute p mod m and print the result as a base b integer. p mod m is defined as the smallest non-negative integer k such that p = a*m + k for so
阅读全文
摘要:Phone ListTime Limit:1000MSMemory Limit:65536KTotal Submissions:18122Accepted:5769DescriptionGiven a list of phone numbers, determine if it is consistent in the sense that no number is the prefix of another. Let's say the phone catalogue listed these numbers:Emergency 911Alice 97 625 999Bob 91 1
阅读全文
摘要:RochambeauTime Limit:5000MSMemory Limit:65536KTotal Submissions:1603Accepted:556DescriptionNchildren are playing Rochambeau (scissors-rock-cloth) game with you. One of them is the judge. The rest children are divided into three groups (it is possible that some group is empty). You don’t know who is
阅读全文
摘要:题意:给你 N 件不同的商品,每件商品最多可以买一次。 每件物品对应两个值 pi di pi 表示物品的价值,di 表示可以买的最迟时间(也就是第一天到第 di 天都可以买这件物品) 规定:每天最多可以买一件物品,问你可以得到的最大价值。算法:贪心 看了KB神的题解,他用的并查集,等下贴个代码。思路【贪心版本】:将物品按照价值从大到小排序 依次枚举每件物品 从可以买的最后一天枚举,看是否可以买 注意:标记天数。思路【KB的并查集版本】:将物品按照价值从大到小排序 处理的时候选择最后的一个不冲突点。 ...
阅读全文
摘要:A Bug's LifeTime Limit:10000MSMemory Limit:65536KTotal Submissions:23484Accepted:7639DescriptionBackgroundProfessor Hopper is researching the sexual behavior of a rare species of bugs. He assumes that they feature two different genders and that they only interact with bugs of the opposite gender
阅读全文
摘要:算法:并查集。题意:给你 N 个农场 给定 M 条关系 :x y len dir 表示农场 y 在农场 x 的 dir 方向的 len 米处 输入 Q 个问题:x y index 在知道从从第一条关系到第 index 条关系的情况下,判断农场 x 和农场 y 的相对关系。 如果能判断,则输出相对关系:水平距离差 + 垂直距离差 如果不能判断,则输出 -1.注意:每组测试数据中的每个问题中的 index 是按照从小到大的顺序给出的,所以使得问题简单化。思路:p[] 记录父亲节...
阅读全文
摘要:Wireless NetworkTime Limit:10000MSMemory Limit:65536KTotal Submissions:13361Accepted:5659DescriptionAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the n
阅读全文
摘要:Cube StackingTime Limit:2000MSMemory Limit:30000KTotal Submissions:15951Accepted:5448Case Time Limit:1000MSDescriptionFarmer John and Betsy are playing a game with N (1 const int maxn = 30000+10; int p[maxn];
int r[maxn]; //下面的个数
int sum[maxn]; //总个数 int find(int x)
{ if(x == p[x]) return x;...
阅读全文
摘要:原题链接:http://poj.org/problem?id=3280CSUST:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=20437#problem/C转载来自:http://blog.sina.com.cn/s/articlelist_1836701754_0_1.htmlCheapest PalindromeTime Limit:2000MSMemory Limit:65536KTotal Submissions:4305Accepted:2091DescriptionKeeping track of all the co
阅读全文
摘要:原题链接:http://poj.org/problem?id=1159博文转载链接:http://blog.sina.com.cn/s/blog_6d79d83a01016iqg.htmlPalindromeTime Limit:3000MSMemory Limit:65536KTotal Submissions:45704Accepted:15580DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from righ
阅读全文
摘要:原题链接:http://poj.org/problem?id=3624我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=20437#problem/A欢迎来水Charm BraceletTime Limit:1000MSMemory Limit:65536KTotal Submissions:14963Accepted:6840DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she
阅读全文
摘要:原题链接:http://poj.org/problem?id=3928我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=20357#problem/APing pongTime Limit:1000MSMemory Limit:65536KTotal Submissions:1215Accepted:452DescriptionN(3<=N<=20000) ping pong players live along a west-east street(consider the street as a line se
阅读全文
摘要:原题链接:http://poj.org/problem?id=2299Ultra-QuickSortTime Limit:7000MSMemory Limit:65536KTotal Submissions:31043Accepted:11066DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence eleme
阅读全文
摘要:原题链接:http://poj.org/problem?id=2488我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/AA Knight's JourneyTime Limit:1000MSMemory Limit:65536KTotal Submissions:23452Accepted:7944DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again
阅读全文
摘要:DFS 水题原题链接:http://poj.org/problem?id=3620我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/BAvoid The LakesTime Limit:1000MSMemory Limit:65536KTotal Submissions:5563Accepted:2995DescriptionFarmer John's farm was flooded in the most recent storm, a fact only aggravated by t
阅读全文

浙公网安备 33010602011771号