HDU
清溪浅水
这个作者很懒,什么都没留下…
展开
-
HDU——1008——Elevator
文章地址:http://acm.hdu.edu.cn/showproblem.php?pid=1008文章大意:电梯升一层时需要6秒,降一层需要4秒,停留在一层是5秒输入一串数,第一个数n是数组的大小,接下来就有n个数,输入0的时候结束#include using namespace std;int main(){ int n; int a[100]; while(cin>>n原创 2013-08-02 14:30:42 · 616 阅读 · 0 评论 -
A New Growth Industry
A biologist experimenting with DNA modification of bacteria has found a way to make bacterial colonies sensitive to the surrounding population density. By changing the DNA, he is able to "program" t转载 2013-08-11 16:27:49 · 688 阅读 · 0 评论 -
hdu——Rotten Ropes
Problem DescriptionSuppose we have n ropes of equal length and we want to use them to lift some heavy object. A tear-off weight t is associated to each rope, that is, if we try to lift an object, he原创 2013-08-11 16:52:11 · 865 阅读 · 0 评论 -
hdu——Error Correction
Problem DescriptionA boolean matrix has the parity property when each row and each column has an even sum, i.e. contains an even number of bits which are set. Here's a 4 x 4 matrix which has the par原创 2013-08-11 14:47:05 · 918 阅读 · 0 评论 -
hdu——poj2470—— Ambiguous permutations
Problem DescriptionSome programming contest problems are really tricky: not only do they require a different output format from what you might have expected, but also the sample output does not show原创 2013-08-11 15:45:46 · 740 阅读 · 0 评论 -
hdu——Symmetric Order
Problem DescriptionIn your job at Albatross Circus Management (yes, it's run by a bunch of clowns), you have just finished writing a program whose output is a list of names in nondescending order by原创 2013-08-11 16:14:06 · 590 阅读 · 0 评论 -
hdu——An Easy Problem
As we known, data stored in the computers is in binary form. The problem we discuss now is about the positive integers and its binary form.Given a positive integer I, you task is to find out an原创 2013-08-11 14:44:57 · 604 阅读 · 0 评论 -
hdu——2602——Bone Collector 01背包问题
Problem DescriptionMany years ago , in Teddy’s hometown there was a man who was called “Bone Collector”. This man like to collect varies of bones , such as dog’s , cow’s , also he went to the grave原创 2013-08-12 20:01:31 · 505 阅读 · 0 评论 -
HDU——1004——Let the Balloon Rise
#include #include using namespace std;int main(){ int n; char s[100]; while(cin>>n) { if(n==0) return 0; mapmap1; map::iterator p; for(int i=0;i<n;i++) { cin>>s; map1原创 2013-08-02 11:23:27 · 607 阅读 · 0 评论 -
hdu ——Quick Change
J.P. Flathead’s Grocery Store hires cheap labor to man the checkout stations. The people he hires (usually high school kids) often make mistakes making change for the customers. Flathead, who’s a bit原创 2013-08-11 14:43:36 · 677 阅读 · 0 评论 -
hdu——Knight Moves
Problem DescriptionA friend of you is doing research on the Traveling Knight Problem (TKP) where you are to find the shortest closed tour of knight moves that visits each square of a given set of n原创 2013-08-11 14:42:08 · 667 阅读 · 0 评论 -
hero
Problem DescriptionWhen playing DotA with god-like rivals and pig-like team members, you have to face an embarrassing situation: All your teammates are killed, and you have to fight 1vN.There ar原创 2013-07-29 12:41:19 · 677 阅读 · 0 评论 -
The Snail
#include#includeint is_end(double h, double& dis, double n){ if(dis > h) return 1; else { dis -= n; if(dis < 0) return -1; } return 0;}int main(){ int i原创 2013-07-30 10:23:17 · 473 阅读 · 0 评论 -
hdu——War
Problem Description War is the reciprical and violent application of force between hostile political entities aimed at bringing about a desired political end-state via armed conflict. War is an原创 2013-08-06 14:41:25 · 704 阅读 · 0 评论 -
HDU ——2054 ——A==B?
#include#includeusing namespace std;char a[100000],b[100000];int main(){ int i,j; while (cin>>a>>b) { for (i=0;istrlen(a);i++) { if (a[i]=='.')原创 2013-07-22 22:15:41 · 525 阅读 · 0 评论 -
HDU——2050——折线分割平面
#include using namespace std;long long a[10002];void fn(){ a[0]=0; a[1]=2; a[2]=7; for(int i=3;i<10002;i++) { a[i]=a[i-1]+4*(i-1)+1; }}int main(){ int n;原创 2013-07-22 22:30:41 · 591 阅读 · 0 评论 -
HDU——2047——阿牛的EOF牛肉串
#include using namespace std;long long a[42];void fn(){ a[0]=0; a[1]=3; a[2]=8; a[3]=22; for(int i=4;i<42;i++) { a[i]=2*a[i-1]+2*a[i-2]; }}int main(){ in原创 2013-07-23 08:32:04 · 798 阅读 · 0 评论 -
HDU——2052——Picture
#include using namespace std;int main(){ int m,n; char a[80][80]; while(cin>>m>>n) { for(int i=0;i<n+2;i++) { for(int j=0;j<m+2;j++) {原创 2013-07-22 22:22:53 · 510 阅读 · 0 评论 -
HDU——Queuing
Problem DescriptionQueues and Priority Queues are data structures which are known to most computer scientists. The Queue occurs often in our daily life. There are many people lined up at the lunch t原创 2013-08-06 19:01:23 · 697 阅读 · 0 评论 -
hdu——1251—— 统计难题
Problem DescriptionIgnatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Input输入数据的第一部分是一张单词表,每行一个单词,单词的长度不超过10,它们代表的是老师交给Ignatius统计的单词,一个空行代表单词表的结束.第二部分是一连原创 2013-08-14 17:33:53 · 588 阅读 · 0 评论 -
hdu——1671——Phone List
Problem DescriptionGiven 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:1. Emergenc原创 2013-08-14 20:14:06 · 718 阅读 · 0 评论 -
hdu——1856—— More is better
Problem DescriptionMr Wang wants some boys to help him with a project. Because the project is rather complex, the more boys come, the better it will be. Of course there are certain requirements.原创 2013-08-16 09:35:36 · 581 阅读 · 0 评论 -
hdu——1018——Big Number
Problem DescriptionIn many applications very large integers numbers are required. Some of these applications are using keys for secure transmission of data, encryption, etc. In this problem you are原创 2013-09-03 19:41:25 · 515 阅读 · 0 评论 -
hdu——3177——Crixalis's Equipment
Problem DescriptionCrixalis - Sand King used to be a giant scorpion(蝎子) in the deserts of Kalimdor. Though he's a guardian of Lich King now, he keeps the living habit of a scorpion like living und原创 2013-09-04 19:55:33 · 595 阅读 · 0 评论 -
hdu——2104——hide handkerchief
Problem DescriptionThe Children’s Day has passed for some days .Has you remembered something happened at your childhood? I remembered I often played a game called hide handkerchief with my friends.原创 2013-09-05 13:39:43 · 591 阅读 · 1 评论 -
hdu——1032——The 3n + 1 problem
Problem DescriptionProblems in Computer Science are often classified as belonging to a certain class of problems (e.g., NP, Unsolvable, Recursive). In this problem you will be analyzing a property o原创 2013-10-23 20:12:20 · 610 阅读 · 0 评论 -
hdu——1201——18岁生日
Problem DescriptionGardon的18岁生日就要到了,他当然很开心,可是他突然想到一个问题,是不是每个人从出生开始,到达18岁生日时所经过的天数都是一样的呢?似乎并不全都是这样,所以他想请你帮忙计算一下他和他的几个朋友从出生到达18岁生日所经过的总天数,让他好来比较一下。 Input一个数T,后面T行每行有一个日期,格式是YYYY-MM-D原创 2013-11-06 20:58:50 · 520 阅读 · 0 评论 -
hdu——2099——整除的尾数
Problem Description一个整数,只知道前几位,不知道末二位,被另一个整数除尽了,那么该数的末二位该是什么呢? Input输入数据有若干组,每组数据包含二个整数a,b(0 Output对应每组数据,将满足条件的所有尾数在一行内输出,格式见样本输出。同组数据的输出,其每个尾数之间空一格,行末没有空格。 Sample Input200 4019原创 2014-02-28 19:02:16 · 606 阅读 · 0 评论 -
hdu——2097——Sky数(水)
Problem DescriptionSky从小喜欢奇特的东西,而且天生对数字特别敏感,一次偶然的机会,他发现了一个有趣的四位数2992,这个数,它的十进制数表示,其四位数字之和为2+9+9+2=22,它的十六进制数BB0,其四位数字之和也为22,同时它的十二进制数表示1894,其四位数字之和也为22,啊哈,真是巧啊。Sky非常喜欢这种四位数,由于他的发现,所以这里我们命名其为Sky数。但是要原创 2014-02-28 19:36:42 · 573 阅读 · 0 评论 -
hdu——2603——Wiskey's Power
Problem DescriptionCome back school from the 33rdACM / ICPC Asia ChenDu, everyone is exhausted, in particular the captain Wiskey. As saying that night, Wiskey drink a lot of wine, just as he blurred原创 2014-03-16 22:34:08 · 649 阅读 · 0 评论 -
hdu ——1242——Rescue
Problem DescriptionAngel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M Angel's friends want to save Angel. Their task is: approach Angel. W原创 2013-09-03 14:49:34 · 614 阅读 · 1 评论 -
poj——2262——Goldbach's Conjecture
DescriptionIn 1742, Christian Goldbach, a German amateur mathematician, sent a letter to Leonhard Euler in which he made the following conjecture: Every even number greater than 4 can be writt原创 2013-09-09 19:04:52 · 622 阅读 · 0 评论 -
hdu——1232——畅通工程
Problem Description某省调查城镇交通状况,得到现有城镇道路统计表,表中列出了每条道路直接连通的城镇。省政府“畅通工程”的目标是使全省任何两个城镇间都可以实现交通(但不一定有直接的道路相连,只要互相间接通过道路可达即可)。问最少还需要建设多少条道路? Input测试输入包含若干测试用例。每个测试用例的第1行给出两个正整数,分别是城镇数目N (原创 2013-08-16 10:07:25 · 544 阅读 · 0 评论 -
hdu——1003——Max Sum
Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 +原创 2013-08-16 11:09:37 · 546 阅读 · 0 评论 -
hdu——2594——Simpsons’ Hidden Talents
Problem DescriptionHomer: Marge, I just figured out a way to discover some of the talents we weren’t aware we had.Marge: Yeah, what is it?Homer: Take me for example. I want to find out if I have原创 2013-08-16 20:27:07 · 590 阅读 · 0 评论 -
深搜——The doggie
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could feel the ground sinking. He re转载 2013-07-29 15:50:59 · 1228 阅读 · 0 评论 -
hdu——1711——Number Sequence
Problem DescriptionGiven two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a number K which make a[K] = b原创 2013-08-16 19:58:51 · 599 阅读 · 0 评论 -
hdu——1078——FatMouse and Cheese:记忆化搜索
Problem DescriptionFatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At eac原创 2013-08-17 20:04:26 · 769 阅读 · 0 评论 -
hdu——1573—— X问题
Problem Description求在小于等于N的正整数中有多少个X满足:X mod a[0] = b[0], X mod a[1] = b[1], X mod a[2] = b[2], …, X mod a[i] = b[i], … (0 Input输入数据的第一行为一个正整数T,表示有T组测试数据。每组测试数据的第一行为两个正整数N,M (0 Outpu原创 2013-09-09 17:38:37 · 785 阅读 · 0 评论 -
poj——1152——An Easy Problem!
DescriptionHave you heard the fact "The base of every normal number system is 10" ? Of course, I am not talking about number systems like Stern Brockot Number System. This problem has nothing to d原创 2013-09-09 20:29:32 · 690 阅读 · 0 评论