随笔分类 -  ACM

摘要:http://poj.org/problem?id=3415Common SubstringsTime Limit:5000MSMemory Limit:65536KTotal Submissions:5805Accepted:1911DescriptionA substring of a stringTis defined as:T(i,k)=TiTi+1...Ti+k-1, 1≤i≤i+k-1≤|T|.Given two stringsA,Band one integerK, we defineS, a set of triples (i,j,k):S= {(i,j,k) |k≥K,A(i 阅读全文
posted @ 2013-07-24 19:55 crazy_apple 阅读(394) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=3250Bad Hair DayTime Limit:2000MSMemory Limit:65536KTotal Submissions:11473Accepted:3871DescriptionSome of Farmer John'sNcows (1 ≤N≤ 80,000) are having a bad hair day! Since each cow is self-conscious about her messy hairstyle, FJ wants to count the number of other cows 阅读全文
posted @ 2013-07-23 22:23 crazy_apple 阅读(419) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=2559Largest Rectangle in a HistogramTime Limit:1000MSMemory Limit:65536KTotal Submissions:12297Accepted:3974DescriptionA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different height 阅读全文
posted @ 2013-07-23 19:44 crazy_apple 阅读(1347) 评论(1) 推荐(0)
摘要:http://poj.org/problem?id=2406Power StringsTime Limit:3000MSMemory Limit:65536KTotal Submissions:27003Accepted:11311DescriptionGiven two strings a and b we define a*b to be their concatenation. For example, if a = "abc" and b = "def" then a*b = "abcdef". If we think of 阅读全文
posted @ 2013-07-23 16:39 crazy_apple 阅读(257) 评论(0) 推荐(0)
摘要:http://poj.org/problem?id=2440DNATime Limit:1000MSMemory Limit:65536KTotal Submissions:3254Accepted:1285DescriptionA kind of virus has attacked the X planet, and many lives are infected. After weeks of study, The CHO (Creature Healthy Organization) of X planet finally finds out that this kind of vir 阅读全文
posted @ 2013-07-22 11:22 crazy_apple 阅读(518) 评论(0) 推荐(0)
摘要:http://ac.nbutoj.com/Problem/view.xhtml?id=1475[1475] Bachelor时间限制: 1000 ms 内存限制: 65535 K问题描述炎热的暑期集训就要结束了,在这短短的20天,大家都很努力,因为很多都是光棍嘛。balabala 所以 Marknoon 先森一直耿耿于怀,毕竟他也是单身嘛。 有一天,Marknoon 先森看着一串数字,发现了那个跟他同命相连的数字1,所以他就开始无聊起来,想知道从数字1到数字N,一共出现了几个1。 例如N=12,则1的个数为5,出现1的数字分别为1,10,11,12。输入输入一个数N(1 2 #include. 阅读全文
posted @ 2013-07-21 11:12 crazy_apple 阅读(323) 评论(0) 推荐(0)
摘要:Bridging signalsTime Limit:1000MSMemory Limit:10000KTotal Submissions:9234Accepted:5037Description'Oh no, they've done it again', cries the chief designer at the Waferland chip factory. Once more the routing designers have screwed up completely, making the signals on the chip connecting 阅读全文
posted @ 2013-07-17 12:25 crazy_apple 阅读(435) 评论(0) 推荐(0)
摘要:http://soj.me/show_problem.php?pid=1001&cid=10041001. Black MagicDescriptionBelieve it or not, there is a powerful black magic, invented by Mage Philia, which will make one person fall in love with an OTAKU. Needless to say, this is the ultimate goal for all of you. However, in order to learn th 阅读全文
posted @ 2013-04-29 20:11 crazy_apple 阅读(246) 评论(0) 推荐(0)
摘要:http://ac.nbutoj.com/Problem/view.xhtml?id=1441[1441] Babelfish时间限制: 1000 ms 内存限制: 65535 K问题描述You have just moved from Waterloo to a big city. The people here speak an incomprehensible dialect of a foreign language. Fortunately, you have a dictionary to help you understand them.输入Input consists of u 阅读全文
posted @ 2013-04-26 20:06 crazy_apple 阅读(218) 评论(0) 推荐(0)
摘要:http://ac.nbutoj.com/Problem/view.xhtml?id=1173[1173] Birdlike Angry Pig时间限制: 1000 ms 内存限制: 65535 K问题描述There's no end to revenge. Pigs like to eat birds' eggs, so birds decide to revenge. For this, pigs decide to revenge as well. Pigs give a task to a birdlike pig. They let he sneak into the 阅读全文
posted @ 2013-04-09 21:38 crazy_apple 阅读(408) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3325Arithmetically ChallengedTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 331Accepted Submission(s): 139Problem DescriptionChallenge 24 is a popular mathematics game used in many grade schools. In each g 阅读全文
posted @ 2013-04-08 19:55 crazy_apple 阅读(307) 评论(0) 推荐(0)
摘要:题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1381Crazy SearchTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1178Accepted Submission(s): 459Problem DescriptionMany people like to solve hard puzzles some of which may lead them to madness. One suc 阅读全文
posted @ 2013-04-05 18:22 crazy_apple 阅读(295) 评论(0) 推荐(0)
摘要:hdu 2037 今年暑假不ACProblem Description“今年暑假不AC?”“是的。”“那你干什么呢?”“看世界杯呀,笨蛋!”“@#$%^&*%...”确实如此,世界杯来了,球迷的节日也来了,估计很多ACMer也会抛开电脑,奔向电视了。作为球迷,一定想看尽量多的完整的比赛,当然,作为新时代的好青年,你一定还会看一些其它的节目,比如新闻联播(永远不要忘记关心国家大事)、非常6+7、超级女生,以及王小丫的《开心辞典》等等,假设你已经知道了所有你喜欢看的电视节目的转播时间表,你会合理安排吗?(目标是能看尽量多的完整节目)Input输入数据包含多个测试实例,每个测试实例的第一行只 阅读全文
posted @ 2013-04-04 16:38 crazy_apple 阅读(106) 评论(0) 推荐(0)
摘要:hdu 2074 叠筐Problem Description需要的时候,就把一个个大小差一圈的筐叠上去,使得从上往下看时,边筐花色交错。这个工作现在要让计算机来完成,得看你的了。Input输入是一个个的三元组,分别是,外筐尺寸n(n为满足0<n<80的奇整数),中心花色字符,外筐花色字符,后二者都为ASCII可见字符;Output输出叠在一起的筐图案,中心花色与外筐花色字符从内层起交错相叠,多筐相叠时,最外筐的角总是被打磨掉。叠筐与叠筐之间应有一行间隔。Sample Input11 B A5 @ WSample Output AAAAAAAAA ABBBBBBBBBAABAAAAA 阅读全文
posted @ 2013-04-04 16:37 crazy_apple 阅读(1553) 评论(0) 推荐(0)
摘要:转自:http://www.cnblogs.com/fangyukuan/archive/2010/09/21/1832364.html【STL】list基础各个容器有很多的相似性。先学好一个,其它的就好办了。先从基础开始。先看看他们的分类吧标准STL序列容器:vector、string、deque和list。标准STL关联容器:set、multiset、map和multimap。非标准序列容器slist和rope。slist是一个单向链表,rope本质上是一个重型字符串。非标准关联容器hash_set、hash_multiset、hash_map和hash_multimap。(各容器成员对比 阅读全文
posted @ 2013-04-03 22:05 crazy_apple 阅读(293) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3350Problem DescriptionHave you used #define in C/C++ code like the code below?#include <stdio.h> #define MAX(a , b) ((a) > (b) ? (a) : (b)) int main() { printf("%d\n" , MAX(2 + 3 , 4)); return 0; }Run the code and get an output: 5, right? 阅读全文
posted @ 2012-12-30 16:20 crazy_apple 阅读(281) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4287Problem Description We all use cell phone today. And we must be familiar with the intelligent English input method on the cell phone. To be specific, the number buttons may correspond to some English letters respectively, as shown below: 2 : a, b, c3 :.. 阅读全文
posted @ 2012-09-10 21:06 crazy_apple 阅读(363) 评论(0) 推荐(0)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1166Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。中央情报局要研究敌人究竟演习什么战术,所以Tidy要随时向Derek汇报某一段连续的工兵营地一共有多少人,例如De 阅读全文
posted @ 2012-08-30 18:53 crazy_apple 阅读(217) 评论(0) 推荐(0)