
HDU
三更鬼
这个作者很懒,什么都没留下…
展开
-
N皇后问题||HDU2553
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2553 Problem Description在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。你的任务是,对于给定的N,求出有多少种合法的放置方法。Input共有若干行,每行一个正整数N≤10,表示棋原创 2018-01-24 17:04:47 · 485 阅读 · 1 评论 -
Saving HDU||HDU2111
link:http://acm.hdu.edu.cn/showproblem.php?pid=2111 Problem Description话说上回讲到海东集团面临内外交困,公司的元老也只剩下XHD夫妇二人了。显然,作为多年拼搏的商人,XHD不会坐以待毙的。 一天,当他正在苦思冥想解困良策的时候,突然想到了自己的传家宝,那是公司成立的时候,父亲作为贺礼送来的一个锦囊,徐父当时交代,不到万不得原创 2017-08-11 20:53:55 · 291 阅读 · 0 评论 -
Max Sum||HDU1003
link:http://acm.hdu.edu.cn/showproblem.php?pid=1003 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,-原创 2017-08-11 10:29:24 · 203 阅读 · 0 评论 -
饭卡||HDU2546
link:http://acm.hdu.edu.cn/showproblem.php?pid=2546 Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每原创 2017-08-10 20:47:43 · 348 阅读 · 0 评论 -
Robberies||HDU2955
link:http://acm.hdu.edu.cn/showproblem.php?pid=2955 Problem DescriptionThe aspiring Roy the Robber has seen a lot of American movies, and knows that the bad guys usually gets caught in the end, often原创 2017-08-10 18:26:49 · 236 阅读 · 0 评论 -
还是畅通工程||HDU1233
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233Problem Description某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。Input测试输入包含原创 2017-08-03 16:32:25 · 785 阅读 · 0 评论 -
畅通工程||HDU1863
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1863Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input测试输入包含若原创 2017-08-03 16:18:21 · 332 阅读 · 0 评论 -
Color the ball||HDU1556
link:http://acm.hdu.edu.cn/showproblem.php?pid=1556Problem DescriptionN个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a <= b),lele便为骑上他的“小飞鸽"牌电动车从气球a开始到气球b依次给每个气球涂一次颜色。但是N次以后lele已经忘记了第I个气球已经涂过几次颜色了,你能帮他算出每个气球原创 2017-08-17 20:41:01 · 312 阅读 · 0 评论 -
敌兵布阵||HDU1166
link:http://acm.hdu.edu.cn/showproblem.php?pid=1166 Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握原创 2017-08-17 20:01:46 · 263 阅读 · 0 评论 -
Clock||HDU1209
link:http://acm.hdu.edu.cn/showproblem.php?pid=1209Problem DescriptionThere is an analog clock with two hands: an hour hand and a minute hand. The two hands form an angle. The angle is measured as the原创 2017-08-11 20:58:45 · 355 阅读 · 0 评论 -
畅通工程再续||HDU1875
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1875Problem Description相信大家都听说一个“百岛湖”的地方吧,百岛湖的居民生活在不同的小岛中,当他们想去其他的小岛时都要通过划小船来实现。现在政府决定大力发展百岛湖,发展首先要解决的问题当然是交通问题,政府决定实现百岛湖的全畅通!经过考察小组RPRush对百岛湖的情况充分了解后,决定在原创 2017-08-03 17:56:43 · 389 阅读 · 0 评论 -
Girls and Boys||HDU1068
link:http://acm.hdu.edu.cn/showproblem.php?pid=1068 Problem Descriptionthe second year of the university somebody started a study on the romantic relations between the students. The relation “romantic原创 2017-08-20 11:19:14 · 260 阅读 · 0 评论 -
HDU2709||Sumsets
link:http://acm.hdu.edu.cn/showproblem.php?pid=2709 Farmer John commanded his cows to search for different sets of numbers that sum to a given number. The cows use only numbers that are an integer p原创 2017-10-01 16:56:13 · 2455 阅读 · 0 评论 -
又见GCD ||HDU2053
有三个正整数a,b,c(0int gcd(int a,int b){ if(b==0) return a; return gcd(b,a%b);}int main(){ int a,b,c,i,t; scanf("%d",&t); while(t--) { scanf("%d%d",&a,&b原创 2017-07-24 16:57:37 · 275 阅读 · 0 评论 -
最少拦截系统||HDU1257
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1257Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的原创 2017-08-07 11:33:20 · 286 阅读 · 0 评论 -
免费馅饼||HDU1176
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1176Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径原创 2017-08-07 10:46:52 · 232 阅读 · 0 评论 -
Ignatius and the Princess IV||HDU1029
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1029Problem Description"OK, you are not too bad, em... But you can never pass the next test." feng5166 says."I will tell you an odd number N, and then N i原创 2017-08-07 10:41:57 · 184 阅读 · 0 评论 -
最短路||HDU2544
文章转自某大佬:http://blog.csdn.net/shuangde800/article/details/7987134 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544 题目:Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛转载 2017-08-05 20:51:02 · 221 阅读 · 0 评论 -
最短路||HDU2544
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2544Problem Description在每年的校赛里,所有进入决赛的同学都会获得一件很漂亮的t-shirt。但是每当我们的工作人员把上百件的衣服从商店运回到赛场的时候,却是非常累的!所以现在他们想要寻找最短的从商店到赛场的路线,你可以帮助他们吗?Input输入包括多组数据。每组数据第一行是两个整数原创 2017-08-05 20:45:33 · 214 阅读 · 0 评论 -
过山车||HDU2063
link:http://acm.hdu.edu.cn/showproblem.php?pid=2063Problem DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK原创 2017-08-20 10:54:24 · 337 阅读 · 0 评论 -
I Hate It||HDU1754
link:http://acm.hdu.edu.cn/showproblem.php?pid=1754Problem Description很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。这让很多学生很反感。不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。Input本题目包含多组测试,请处原创 2017-08-17 16:58:22 · 219 阅读 · 0 评论 -
小希的迷宫||HDU1272
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1272Problem Description上次Gardon的迷宫城堡小希玩了很久(见Problem B),现在她也想设计一个迷宫让Gardon来走。但是她设计迷宫的思路不一样,首先她认为所有的通道都应该是双向连通的,就是说如果有一个通道连通了房间A和B,那么既可以通过它从房间A走到房间B,也可以通过它从原创 2017-08-02 20:17:39 · 319 阅读 · 0 评论 -
Super Jumping! Jumping! Jumping!||HDU1087
Link:http://acm.hdu.edu.cn/showproblem.php?pid=1087 Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and kn原创 2017-08-08 18:05:25 · 208 阅读 · 0 评论 -
Common Subsequence||HDU1159
Link:http://acm.hdu.edu.cn/showproblem.php?pid=1159Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = <x1, x2,原创 2017-08-08 16:55:34 · 240 阅读 · 0 评论 -
Monkey and Banana||HDU1069
Link:http://acm.hdu.edu.cn/showproblem.php?pid=1069 Problem DescriptionA group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building,原创 2017-08-08 16:50:12 · 223 阅读 · 0 评论 -
Wolf and Rabbit||HDU1222
link:http://acm.hdu.edu.cn/showproblem.php?pid=1222 Problem DescriptionThere is a hill with n holes around. The holes are signed from 0 to n-1.A rabbit must hide in one of the holes. A wolf searches t原创 2017-08-07 21:21:34 · 212 阅读 · 0 评论 -
分拆素数和||HDU2098
link:http://acm.hdu.edu.cn/showproblem.php?pid=2098 Problem Description 把一个偶数拆成两个不同素数的和,有几种拆法呢?Input 输入包含一些正的偶数,其值不会超过10000,个数不会超过500,若遇0,则结束。Output 对应每个偶数,输出其拆成不同素数的个数,每个结果占一行。Sample Input30 26原创 2017-08-07 21:18:33 · 224 阅读 · 0 评论 -
Longest Ordered Subsequence ||POJ2533
题目链接:http://poj.org/problem?id=2533 DescriptionA 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,原创 2017-08-07 19:41:19 · 331 阅读 · 0 评论 -
Max Sum Plus Plus||HDU1024
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1024Problem DescriptionNow I think you have got an AC in Ignatius.L's "Max Sum" problem. To be a brave ACMer, we always challenge ourselves to more diffic原创 2017-08-07 16:49:31 · 233 阅读 · 0 评论 -
找新朋友||HDU1286
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1286 Problem Description 新年快到了,“猪头帮协会”准备搞一个聚会,已经知道现有会员N人,把会员从1到N编号,其中会长的号码是N号,凡是和会长是老朋友的,那么该会员的号码肯定和N有大于1的公约数,否则都是新朋友,现在会长想知道究竟有几个新朋友?请你编程序帮会长计算出来。Input原创 2017-07-30 21:11:17 · 321 阅读 · 0 评论 -
Piggy-Bank||HDU1114
Link:http://acm.hdu.edu.cn/showproblem.php?pid=1114 Problem DescriptionBefore ACM can do anything, a budget must be prepared and the necessary financial support obtained. The main income for this acti原创 2017-08-08 20:31:31 · 223 阅读 · 0 评论 -
美素数HDU4548
小明对数的研究比较热爱,一谈到数,脑子里就涌现出好多数的问题,今天,小明想 考考你对素数的认识。 问题是这样的:一个十进制数,如果是素数,而且它的各位数字和也是素数,则称之为“美素数”,如29,本身是素数,而且2+9 = 11也是素数,所以它是美素数。 给定一个区间,你能计算出这个区间内有多少个美素数吗? 例子忘记了 主要用素数打表就可做出#include<stdio.h>#in原创 2017-07-24 17:01:56 · 479 阅读 · 0 评论 -
剪花布条||HDU2087
link:http://acm.hdu.edu.cn/showproblem.php?pid=2087Problem Description一块花布条,里面有些图案,另有一块直接可用的小饰条,里面也有一些图案。对于给定的花布条和小饰条,计算一下能从花布条中尽可能剪出几块小饰条来呢?Input输入中含有一些数据,分别是成对出现的花布条和小饰条,其布条都是用可见ASCII字符表示的,可见的ASCII字原创 2017-08-16 11:01:55 · 305 阅读 · 0 评论 -
find the most comfortable road||HDU1598
link:http://acm.hdu.edu.cn/showproblem.php?pid=1598 Problem DescriptionXX星有许多城市,城市之间通过一种奇怪的高速公路SARS(Super Air Roam Structure---超级空中漫游结构)进行交流,每条SARS都对行驶在上面的Flycar限制了固定的Speed,同时XX星人对 Flycar的“舒适度”有特殊要求,即原创 2017-08-09 20:41:56 · 224 阅读 · 0 评论 -
The All-purpose Zero||HDU5773
link:http://acm.hdu.edu.cn/showproblem.php?pid=5773 Problem Description?? gets an sequence S with n intergers(0 < n <= 100000,0<= S[i] <= 1000000).?? has a magic so that he can change 0 to any interge原创 2017-08-09 18:20:14 · 283 阅读 · 0 评论 -
Rikka with Graph||HDU5631
Problem DescriptionAs we know, Rikka is poor at math. Yuta is worrying about this situation, so he gives Rikka some math tasks to practice. There is one of them:Yuta has a non-direct graph with n verti原创 2017-08-02 17:26:44 · 281 阅读 · 0 评论 -
More is better||HDU1856
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1856Problem 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 b原创 2017-08-02 16:45:59 · 253 阅读 · 0 评论 -
Bellovin||HDU5748
link:http://acm.hdu.edu.cn/showproblem.php?pid=5748 Problem DescriptionPeter has a sequence a1,a2,...,an and he define a function on the sequence -- F(a1,a2,...,an)=(f1,f2,...,fn), where fi is the len原创 2017-08-09 17:45:45 · 279 阅读 · 0 评论 -
最大上升子序列长度
给你一个数组,求出它最大上升子序列的长度 比如数组 4 2 3 1 1 1 5 求出最大上升子序列长度也就是3,是2 3 5 注意子串和子序列的区别,子串连续,子序列不一定 那么看上面这个数组,一般的方法时间复杂度是o(n^2) 我这儿使用lower_bound(),复杂度为o(n*logn) 这个原理是 先给dp数组所有元素赋值 INF=0x3f3f3f3f 然后开始比较,原创 2017-08-09 15:47:56 · 949 阅读 · 0 评论 -
怪盗基德的挑战书||HDU4552
link:http://acm.hdu.edu.cn/showproblem.php?pid=4552 Problem Description“在树最美丽的那天,当时间老人再次把大钟平均分开时,我会降临在灯火之城的金字塔前,带走那最珍贵的笑容。”这是怪盗基德盗取巴黎卢浮宫的《蒙娜丽莎的微笑》这幅画时,挑战书上的内容。但这次,怪盗基德的挑战书上出现了一串串小写字母“aaab sdfeeddd...原创 2017-08-16 17:00:56 · 585 阅读 · 0 评论