03 2012 档案

HDU 1027 Ignatius and the Princess II (产生第m大的排列,STLmap中的next_permutation(array,array+n);)
摘要:Ignatius and the Princess IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2272Accepted Submission(s): 1371Problem DescriptionNow our hero finds the door to the BEelzebub feng5166. He opens the door and finds feng5166 is about to kill our pretty P 阅读全文

posted @ 2012-03-30 00:47 kuangbin 阅读(702) 评论(0) 推荐(0)

C++STL的next_permutation
摘要:C++STL的next_permutation在标准库算法中,next_permutation应用在数列操作上比较广泛.这个函数可以计算一组数据的全排列.但是怎么用,原理如何,我做了简单的剖析.首先查看stl中相关信息.函数原型:template<class BidirectionalIterator> bool next_permutation( BidirectionalIterator _First, BidirectionalIterator _Last );template<class BidirectionalIterator, class BinaryPredi 阅读全文

posted @ 2012-03-30 00:44 kuangbin 阅读(10514) 评论(3) 推荐(6)

HDU 1026 Ignatius and the Princess I (BFS+优先队列,记录路径)
摘要:Ignatius and the Princess ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5989Accepted Submission(s): 1816Special JudgeProblem DescriptionThe Princess has been abducted by the BEelzebub feng5166, our hero Ignatius has to rescue our pretty Princess 阅读全文

posted @ 2012-03-30 00:29 kuangbin 阅读(1374) 评论(0) 推荐(0)

POJ 2007 Scrambled Polygon(极角排序)
摘要:Scrambled PolygonTime Limit: 1000MSMemory Limit: 30000KTotal Submissions: 4849Accepted: 2293DescriptionA closed polygon is a figure bounded by a finite number of line segments. The intersections of the bounding line segments are called the vertices of the polygon. When one starts at any vertex of a 阅读全文

posted @ 2012-03-25 21:58 kuangbin 阅读(787) 评论(0) 推荐(0)

POJ 1696 Space Ant(极角排序)
摘要:Space AntTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 1799Accepted: 1147DescriptionThe most exciting space discovery occurred at the end of the 20th century. In 1999, scientists traced down an ant-like creature in the planet Y1999 and called it M11. It has only one eye on the left side o 阅读全文

posted @ 2012-03-25 21:35 kuangbin 阅读(1218) 评论(3) 推荐(0)

移动 II (广搜,记录路径)
摘要:移动 IITime Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 27(14 users)Total Accepted: 16(14 users)Special Judge: NoDescription在坐标轴[0,500]上存在两点A,B。点A可以多次移动,每次移动需要遵循如下规则:1.向后移动一步。2.向前移动一步。3.跳到当前坐标*2的位置上。要求:利用宽搜算法编程求解从A移动到B的步数最少的方案,为使答案统一,要求搜索按照规则1、2、3的顺序进行。Input输入包含多组测试用例。每组测试用例要求输入两个整数A,B。Output按要求输 阅读全文

posted @ 2012-03-25 21:10 kuangbin 阅读(637) 评论(0) 推荐(0)

消除用电脑眼睛疲劳的设置
摘要:告诉大家一种保护眼睛的好方法: 桌面->右键->属性->外观->高级->项目选择(窗口)、颜色1(L)选择(其它)将色调改为:85。饱和度:123。亮度:205->添加到自定义颜色->在自定义颜色选定点确定->确定 这样所有的文档都不再是刺眼的白底黑字,而是非常柔和的豆沙绿色,这个色调是眼科专家配置的,长时间使用会很有效的缓解眼睛疲劳保护眼睛 阅读全文

posted @ 2012-03-23 22:22 kuangbin 阅读(361) 评论(0) 推荐(0)

HDU 1049 Climbing Worm(水题)
摘要:Climbing WormTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7047Accepted Submission(s): 4455Problem DescriptionAn inch worm is at the bottom of a well n inches deep. It has enough energy to climb u inches every minute, but then has to rest a minut 阅读全文

posted @ 2012-03-23 11:13 kuangbin 阅读(4188) 评论(1) 推荐(0)

HDU 1025 Constructing Roads In JGShining's Kingdom(最长上升子序列的长度)
摘要:Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7192Accepted Submission(s): 2103Problem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two 阅读全文

posted @ 2012-03-22 23:50 kuangbin 阅读(2714) 评论(0) 推荐(1)

A Strange Dog called Vagaa II (矩阵相乘)
摘要:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1100矩阵相乘法A Strange Dog called Vagaa IITime Limit: 1000 MSMemory Limit: 65536 KTotal Submit: 105(32 users)Total Accepted: 29(23 users)Special Judge: NoDescriptionLeyni has a strange dog called Vagaa and it is just born.( 阅读全文

posted @ 2012-03-22 22:02 kuangbin 阅读(441) 评论(0) 推荐(1)

HDU 1023 Train Problem II (卡特兰数问题)
摘要:Train Problem IITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2830Accepted Submission(s): 1562Problem DescriptionAs we all know the Train Problem I, the boss of the Ignatius Train Station want to know if all the trains come in strict-increasing o 阅读全文

posted @ 2012-03-21 21:05 kuangbin 阅读(3724) 评论(0) 推荐(1)

卡特兰数总结
摘要:卡特兰数又称卡塔兰数,是组合数学中一个常出现在各种计数问题中出现的数列。由以比利时的数学家欧仁·查理·卡塔兰 (1814–1894)命名。卡特兰数前几项为 (OEIS中的数列A000108): 1, 1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796, 58786, 208012, 742900, 2674440, 9694845, 35357670, 129644790, 477638700, 1767263190, 6564120420, 24466267020, 91482563640, 343059613650, 1289904 阅读全文

posted @ 2012-03-21 21:02 kuangbin 阅读(3111) 评论(0) 推荐(1)

HDU 1015 Safecracker (枚举)
摘要:SafecrackerTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3713Accepted Submission(s): 1919Problem Description=== Op tech briefing, 2002/11/02 06:42 CST === "The item is locked in a Klein safe behind a painting in the second-floor library. Kle 阅读全文

posted @ 2012-03-21 19:07 kuangbin 阅读(1713) 评论(0) 推荐(0)

TopCoder入门教程 — sqybi完善版
摘要:本文根据经典的TC教程完善和改编。TopCoder:http://www.topcoder.com/基本规则TopCoder的比赛类型很多,最常见的是周赛SRM(Single Round Match),另外还有TCHS SRM(TopCoder High School SRM,题目和SRM一样,仅限中学生参加,参赛者水平较低,据说涨rating很容易),马拉松(Marathon Matchs),还有TCOpen(每年两次的大比赛)之类的比赛。因为大多数人都在做SRM,所以本文介绍的TC比赛即为SRM。SRM的规则总结起来就是一句话:75分钟做完3道难度递增的题。TC的每个用户(handle)都 阅读全文

posted @ 2012-03-20 22:24 kuangbin 阅读(758) 评论(1) 推荐(0)

HDU 1022 Train Problem I (数据结构——栈)
摘要:Train Problem ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9012Accepted Submission(s): 3310Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because 阅读全文

posted @ 2012-03-16 02:19 kuangbin 阅读(1061) 评论(0) 推荐(0)

HDU 1229 还是A+B(水题)
摘要:还是A+BTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9799Accepted Submission(s): 4814Problem Description读入两个小于10000的正整数A和B,计算A+B。需要注意的是:如果A和B的末尾K(不超过8)位数字相同,请直接输出-1。Input测试输入包含若干测试用例,每个测试用例占一行,格式为"A B K",相邻两数字有一个空格间隔。当A和B同时为0时输入结束,相应的结果不要 阅读全文

posted @ 2012-03-15 02:20 kuangbin 阅读(433) 评论(0) 推荐(0)

HDU 1228 A + B(水题)
摘要:A + BTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7615Accepted Submission(s): 4307Problem Description读入两个小于100的正整数A和B,计算A+B.需要注意的是:A和B的每一位数字由对应的英文单词给出.Input测试输入包含若干测试用例,每个测试用例占一行,格式为"A + B =",相邻两字符串有一个空格间隔.当A和B同时为0时输入结束,相应的结果不要输出.Outpu 阅读全文

posted @ 2012-03-15 02:14 kuangbin 阅读(461) 评论(0) 推荐(0)

HDU 1011 Starship Troopers(树形DP)
摘要:Starship TroopersTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4118Accepted Submission(s): 1076Problem DescriptionYou, the leader of Starship Troopers, are sent to destroy a base of the bugs. The base is built underground. It is actually a huge 阅读全文

posted @ 2012-03-14 19:00 kuangbin 阅读(3722) 评论(3) 推荐(0)

HrbustOJ 1176 小陈老师、雪人 (STL map 和优先队列)
摘要:http://acm.hrbust.edu.cn/index.php?m=ProblemSet&a=showProblem&problem_id=1176水了一道比较有意思的题目。其实就是给了很多的数。问最多可以搭配出多少种三个不同的数的组合,并且输出。第1行,包含一个整数n(1≤n≤100000) — 雪球的数量。第2行,包含n个整数 — 雪球的半径r1, r2, ..., rn (1≤ri≤1000000000)给的数比较多,也比较大,所以用map 来存。map 来记录个数。然后用优先队列。把各个数的个数入队列。先取个数最多的三个数,个数减一后要再入队。直到队列为空。map 阅读全文

posted @ 2012-03-14 15:52 kuangbin 阅读(555) 评论(0) 推荐(0)

HDU 1009 FatMouse' Trade(贪心)
摘要:FatMouse' TradeTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 20968Accepted Submission(s): 6501Problem DescriptionFatMouse prepared M pounds of cat food, ready to trade with the cats guarding the warehouse containing his favorite food, JavaBea 阅读全文

posted @ 2012-03-13 23:41 kuangbin 阅读(9358) 评论(0) 推荐(3)

HDU 1007 Quoit Design (最小点对,模板题)
摘要:题目很明显,答案就是最小点对距离的一半。最小点对的算法就是分治,把所以点分成两部分,然后合起来,重点是怎么样合起来。算法思想不再赘述,记得有很多资料说这个的。大致思想就是按照x坐标排序,分成左右两部分,求左半部分的最小距离,右半部分的最小距离,d=min(d1,d2)。还有就是分界线两侧小于d的点的距离可能是最小点对。代码如下:(套用的是吉林大学的模板,套用模板果然容易出错,一不小心就打错,多理解)#include<stdio.h>#include<iostream>#include<stdlib.h>#include<string.h>#inc 阅读全文

posted @ 2012-03-13 15:29 kuangbin 阅读(3395) 评论(0) 推荐(0)

VK Cup 2012 Qualification Round 1 E. Phone Talks
摘要:E. Phone Talkstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputCool J has recently become a businessman Mr. Jackson, and he has to make a lot of phone calls now. Today he has n calls planned. For each call we know the moment ti (in seconds since t 阅读全文

posted @ 2012-03-05 16:31 kuangbin 阅读(490) 评论(0) 推荐(0)

VK Cup 2012 Qualification Round 1 D. Ice Sculptures
摘要:D. Ice Sculpturestime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThe Berland University is preparing to celebrate the 256-th anniversary of its founding! A specially appointed Vice Rector for the celebration prepares to decorate the campus. In th 阅读全文

posted @ 2012-03-05 16:30 kuangbin 阅读(656) 评论(0) 推荐(0)

VK Cup 2012 Qualification Round 1 B. Taxi
摘要: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 @ 2012-03-05 16:28 kuangbin 阅读(551) 评论(0) 推荐(0)

VK Cup 2012 Qualification Round 1 A. Next Round
摘要:A. Next Roundtime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard output"Contestant who earns a score equal to or greater than the k-th place finisher's score will advance to the next round, as long as the contestant earns a positive score..." 阅读全文

posted @ 2012-03-05 16:26 kuangbin 阅读(873) 评论(0) 推荐(0)

迎接2012新赛季——HDOJ系列热身赛(2) Problem E HDU4165 Pills
摘要:Problem ETime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0Accepted Submission(s): 0Problem DescriptionAunt Lizzie takes half a pill of a certain medicine every day. She starts with a bottle that contains N pills.On the first day, she removes a rand 阅读全文

posted @ 2012-03-03 13:25 kuangbin 阅读(621) 评论(0) 推荐(0)

迎接2012新赛季——HDOJ系列热身赛(2) Problem A HDU 4161 Iterated Difference
摘要:Problem ATime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 0Accepted Submission(s): 0Problem DescriptionYou are given a list of N non-negative integers a(1), a(2), ... , a(N). You replace the given list by a new list: the k-th entry of the new list i 阅读全文

posted @ 2012-03-03 13:11 kuangbin 阅读(456) 评论(0) 推荐(0)

导航

JAVASCRIPT: