![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
2017寒假
铁锅炖鱼,铜锅涮肉
火龙果奇异果芒果橙子和石榴
展开
-
*寒假水118——FATE 【背包问题】
最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd还说了他最多只杀s只怪。请问他能升掉这最后一级吗?...原创 2018-02-24 01:51:32 · 146 阅读 · 0 评论 -
*寒假水117——贪心【并查集优化】
A supermarket has a set Prod of products on sale. It earns a profit px for each product x∈Prod sold by a deadline dx that is measured as an integral number of time units starting from the moment th...原创 2018-02-24 01:48:53 · 196 阅读 · 0 评论 -
*寒假水116——Number Sequence
A single positive integer i is given. Write a program to find the digit located in the position i in the sequence of number groups S1S2...Sk. Each group Sk consists of a sequence of positive intege...原创 2018-02-24 01:43:11 · 128 阅读 · 0 评论 -
*寒假水115——Big Number 【对数求位数】
In 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 given a number, yo...原创 2018-02-24 01:34:01 · 183 阅读 · 0 评论 -
*寒假水114——贪心【状压】
Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after...原创 2018-02-24 01:23:02 · 151 阅读 · 0 评论 -
*寒假水113——递推
我们看到过很多直线分割平面的题目,今天的这个题目稍微有些变化,我们要求的是n条折线分割平面的最大数目。比如,一条折线可以将平面分成两部分,两条折线最多可以将平面分成7部分,具体如下所示。 Input输入数据的第一行是一个整数C,表示测试实例的个数,然后是C 行数据,每行包含一个整数n(0<n<=10000),表示折线的数量。 Output对于每个测试实例,请输出平面的最大分...原创 2018-02-24 01:18:12 · 113 阅读 · 0 评论 -
*寒假水112——卡特兰数
As 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 order, how many orders that all the trains can get out of the rai...原创 2018-02-24 01:16:00 · 165 阅读 · 0 评论 -
寒假水111——搜索【深搜】
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he c...原创 2018-02-24 01:11:05 · 143 阅读 · 0 评论 -
*寒假水109——搜索【深搜】
Background The knight is getting bored of seeing the same black and white squares again and again and has decided to make a journey around the world. Whenever a knight moves, it is two squares in...原创 2018-02-24 01:07:08 · 155 阅读 · 0 评论 -
*寒假水110——搜索【广搜】
在一个给定形状的棋盘(形状可能是不规则的)上面摆放棋子,棋子没有区别。要求摆放时任意的两个棋子不能放在棋盘中的同一行或者同一列,请编程求解对于给定形状和大小的棋盘,摆放k个棋子的所有可行的摆放方案C。Input输入含有多组测试数据。 每组数据的第一行是两个正整数,n k,用一个空格隔开,表示了将在一个n*n的矩阵内描述棋盘,以及摆放棋子的数目。 n <= 8 , k <...原创 2018-02-24 01:09:08 · 114 阅读 · 0 评论 -
寒假水108——搜索【广搜】
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 10...原创 2018-02-24 01:01:05 · 162 阅读 · 0 评论 -
*寒假水107——搜索【深搜】
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides...原创 2018-02-24 00:56:59 · 167 阅读 · 0 评论 -
*寒假水106——素数环 搜索
A ring is compose of n circles as shown in diagram. Put natural number 1, 2, ..., n into each circle separately, and the sum of numbers in two adjacent circles should be a prime. Note: the number ...原创 2018-02-24 00:51:20 · 128 阅读 · 0 评论 -
*寒假水105——Reduced ID Numbers
T. Chur teaches various groups of students at university U. Every U-student has a unique Student Identification Number (SIN). A SIN s is an integer in the range 0 ≤ s ≤ MaxSIN with MaxSIN = 10 6-1....原创 2018-02-24 00:45:48 · 175 阅读 · 0 评论 -
*寒假水104——Joseph 【打表】
The Joseph's problem is notoriously known. For those who are not familiar with the original problem: from among n people, numbered 1, 2, . . ., n, standing in circle every mth is going to be execut...原创 2018-02-24 00:40:23 · 129 阅读 · 0 评论 -
*寒假水103——Dirichlet's Theorem on Arithmetic Progressions
If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, ..., contains infinitely many prime numbers....原创 2018-02-24 00:36:43 · 137 阅读 · 0 评论 -
*寒假水102——Ignatius and the Princess IV
"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 integers. There will be a special integer among them, you have to...原创 2018-02-24 00:25:42 · 203 阅读 · 0 评论 -
*寒假水101——枚举答案能不能做?
The digital root of a positive integer is found by summing the digits of the integer. If the resulting value is a single digit then that digit is the digital root. If the resulting value contains t...原创 2018-02-24 00:20:42 · 136 阅读 · 0 评论 -
*寒假水100——Big Number 【自然数的位数】
In 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 given a number, yo...原创 2018-02-23 23:46:42 · 284 阅读 · 0 评论 -
*寒假水99——素数表 【筛法求素数】
The young and very promising cryptographer Odd Even has implemented the security module of a large system with thousands of users, which is now in use in his company. The cryptographic keys are cre...原创 2018-02-23 23:40:33 · 235 阅读 · 0 评论 -
*寒假水98——搜索 【深搜】
Technicians in a pathology lab analyze digitized images of slides. Objects on a slide are selected for analysis by a mouse click on the object. The perimeter of the boundary of an object is one use...原创 2018-02-23 23:23:45 · 148 阅读 · 0 评论 -
*寒假水97——Dirichlet's Theorem on Arithmetic Progressions
If a and d are relatively prime positive integers, the arithmetic sequence beginning with a and increasing by d, i.e., a, a + d, a + 2d, a + 3d, a + 4d, ..., contains infinitely many prime numbers....原创 2018-02-23 23:07:50 · 144 阅读 · 0 评论 -
*寒假水96——A + B Problem II 【大数相加】
I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. InputThe first line of the input contains an integer T(1<=T<=20) which means the...原创 2018-02-23 22:57:26 · 133 阅读 · 0 评论 -
*寒假水95——一个人的旅行
虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大段时间,可不能浪费啊,一定要给自己好好的...原创 2018-02-23 22:43:13 · 130 阅读 · 0 评论 -
*寒假水94——A == B ?
Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".Inputeach test case contains two numbers A and B. Outputfor each case, if A is equal to B, you should prin...原创 2018-02-23 22:25:37 · 156 阅读 · 0 评论 -
*寒假水93——Crisis of HDU
话说上回讲到HDU大战东洋小苟,结果自然是中方大胜,这一战也使得海东集团在全球同行业中的地位更加巩固。随着集团的发展,很多创业时期的元老逐步功成身退,先是8600移民海外,然后是linle夫妇退隐山林,逐渐的,最初众多的元老只剩下XHD夫妇和Wiskey三人了。 到了2020年,因为扩张过度加上老鼠数量逐年减少,公司的发展遇到了前所未有的危机,此时集团已经没有任何流动资金,更可怕的是,这个时候,...原创 2018-02-23 22:21:03 · 179 阅读 · 0 评论 -
*寒假水92——A == B ? 【strchr函数】
Give you two numbers A and B, if A is equal to B, you should print "YES", or print "NO".Inputeach test case contains two numbers A and B. Outputfor each case, if A is equal to B, you should prin...原创 2018-02-22 23:49:51 · 253 阅读 · 0 评论 -
*寒假水91——辗转相除法求最大公约数 【辗转相除法】
The least common multiple (LCM) of a set of positive integers is the smallest positive integer which is divisible by all the numbers in the set. For example, the LCM of 5, 7 and 15 is 105. Inpu...原创 2018-02-22 22:13:08 · 190 阅读 · 0 评论 -
*寒假水90——Robot Motion 【搜索】
A robot has been programmed to follow the instructions in its path. Instructions for the next direction the robot is to move are laid down in a grid. The possible instructions are N north (up th...原创 2018-02-22 19:51:21 · 144 阅读 · 0 评论 -
*寒假水89——A + B
读入两个小于100的正整数A和B,计算A+B. 需要注意的是:A和B的每一位数字由对应的英文单词给出. Input测试输入包含若干测试用例,每个测试用例占一行,格式为"A + B =",相邻两字符串有一个空格间隔.当A和B同时为0时输入结束,相应的结果不要输出. Output对每个测试用例输出1行,即A+B的值. Sample Inputone + two =three f...原创 2018-02-22 14:01:36 · 211 阅读 · 0 评论 -
*寒假水88—— 悼念512汶川大地震遇难同胞——珍惜现在,感恩生活【背包问题】
Input输入数据首先包含一个正整数C,表示有C组测试用例,每组测试用例的第一行是两个整数n和m(1<=n<=100, 1<=m<=100),分别表示经费的金额和大米的种类,然后是m行数据,每行包含3个数p,h和c(1<=p<=20,1<=h<=200,1<=c<=20),分别表示每袋的价格、每袋的重量以及对应种类大米的袋数。Out...原创 2018-02-22 10:30:55 · 192 阅读 · 0 评论 -
*寒假水87——How many ways?? 【矩阵快速幂】(不懂)
春天到了, HDU校园里开满了花, 姹紫嫣红, 非常美丽. 葱头是个爱花的人, 看着校花校草竞相开放, 漫步校园, 心情也变得舒畅. 为了多看看这迷人的校园, 葱头决定, 每次上课都走不同的路线去教室, 但是由于时间问题, 每次只能经过k个地方, 比方说, 这次葱头决定经过2个地方, 那他可以先去问鼎广场看看喷泉, 再去教室, 也可以先到体育场跑几圈, 再到教室. 他非常想知道, 从A 点恰...原创 2018-02-22 10:25:58 · 105 阅读 · 0 评论 -
*寒假水86——悼念512汶川大地震遇难同胞——来生一起走【母函数】
今天,灾区又来了n位志愿者,抗震救灾指挥部需要将他们分为若干个小组,小组的数量不限,但是要求每个小组的人数必须为素数,请问我们有几种分组的方法呢? 特别说明: 1、可以只有一个组; 2、分组的方法只和人数有关,而与具体的人员无关,即:你可以假设人是无区别的。 Input输入数据首先包含一个正整数C,表示有C组测试用例,然后是C行数据,每行包含一个正整数n(2<=n<=1...原创 2018-02-22 10:05:34 · 130 阅读 · 0 评论 -
*寒假水85——FATE 【背包问题】
#include<iostream>最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或者0以下时,xhd就不会玩这游戏。xhd...原创 2018-02-22 09:59:37 · 103 阅读 · 0 评论 -
*寒假水84——分数矩阵
我们定义如下矩阵: 1/1 1/2 1/3 1/2 1/1 1/2 1/3 1/2 1/1 矩阵对角线上的元素始终是1/1,对角线两边分数的分母逐个递增。 请求出这个矩阵的总和。 Input每行给定整数N (N<50000),表示矩阵为 N*N.当N为0时,输入结束。Output输出答案,保留2位小数。Sample Input12340Sample Ou...原创 2018-02-22 09:44:24 · 142 阅读 · 0 评论 -
寒假水83——跳舞毯 【DP】
由于长期缺乏运动,小黑发现自己的身材臃肿了许多,于是他想健身,更准确地说是减肥。 小黑买来一块圆形的毯子,把它们分成三等分,分别标上A,B,C,称之为“跳舞毯”,他的运动方式是每次都从A开始跳,每次都可以任意跳到其他块,但最后必须跳回A,且不能原地跳.为达到减肥效果,小黑每天都会坚持跳n次,有天他突然想知道当他跳n次时共几种跳法,结果想了好几天没想出来-_- 现在就请你帮帮他,算出总共有...原创 2018-02-22 09:10:05 · 161 阅读 · 0 评论 -
*寒假水82——仙人球的残影
在美丽的HDU,有一名大三的同学,他的速度是众所周知的,跑100米仅仅用了2秒47,在他跑步过程中会留下残影的哎,大家很想知道他是谁了吧,他叫仙人球,既然名字这样了,于是他的思想是单一的,他总是喜欢从一点出发,经过3次转折(每次向右转90°),回到出发点,而且呢,他每次转折前总是跑相同长度的路程,所以很多人都想知道如果用‘1’算他跑步出发的第一个残影的话,那么回到起点的时候,他的残影是怎么样...原创 2018-02-22 08:58:56 · 187 阅读 · 0 评论 -
*寒假水81——Fruit 【背包问题】
转眼到了收获的季节,由于有TT的专业指导,Lele获得了大丰收。特别是水果,Lele一共种了N种水果,有苹果,梨子,香蕉,西瓜……不但味道好吃,样子更是好看。 于是,很多人们慕名而来,找Lele买水果。 甚至连大名鼎鼎的HDU ACM总教头 lcy 也来了。lcy抛出一打百元大钞,"我要买由M个水果组成的水果拼盘,不过我有个小小的要求,对于每种水果,个数上我有限制,既不能少于某个特定值,...原创 2018-02-22 08:47:05 · 138 阅读 · 0 评论 -
*寒假水80——Worm【DP】
自从见识了平安夜苹果的涨价后,Lele就在他家门口水平种了一排苹果树,共有N棵。 突然Lele发现在左起第P棵树上(从1开始计数)有一条毛毛虫。为了看到毛毛虫变蝴蝶的过程,Lele在苹果树旁观察了很久。虽然没有看到蝴蝶,但Lele发现了一个规律:每过1分钟,毛毛虫会随机从一棵树爬到相邻的一棵树上。 比如刚开始毛毛虫在第2棵树上,过1分钟后,毛毛虫可能会在第1棵树上或者第3棵树上。如果刚开...原创 2018-02-22 08:42:34 · 127 阅读 · 0 评论 -
*寒假水79——Public Sale【巴什博弈】
虽然不想,但是现实总归是现实,Lele始终没有逃过退学的命运,因为他没有拿到奖学金。现在等待他的,就是像FarmJohn一样的农田生涯。 要种田得有田才行,Lele听说街上正在举行一场别开生面的拍卖会,拍卖的物品正好就是一块20亩的田地。于是,Lele带上他的全部积蓄,冲往拍卖会。 后来发现,整个拍卖会只有Lele和他的死对头Yueyue。 通过打听,Lele知道这场拍卖的规则是这样的...原创 2018-02-21 23:29:13 · 123 阅读 · 0 评论