
hdu刷题之路
文章平均质量分 80
qq_33520453
每个人的路注定不同,在盲目羡慕别人取得的成就的时候不如换成在自己颓废的时候想想别人是不是在努力奋斗,没有天生的大牛,临渊羡鱼不如退而结网。
展开
-
hdu 2600 简单贪心
题目大意 就是让你找到一个被区间覆盖的 最大的值这可以用简单的贪心来解决 代码如下#include#include#include#include#include using namespace std;struct Nod{ int s,e;};Nod a[101];int cmp(Nod a,Nod b){ return原创 2016-11-26 21:36:26 · 277 阅读 · 0 评论 -
hdu1258
Given a specified total t and a list of n integers, find all distinct sums using numbers from the list that add up to t. For example, if t=4, n=6, and the list is [4,3,2,2,1,1], then there are four di原创 2017-05-06 23:35:14 · 365 阅读 · 0 评论 -
hdu1241
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 th原创 2017-05-06 17:40:58 · 381 阅读 · 0 评论 -
hdu1172
Problem Description猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这两个数字同时存在于这两个数中,而且1在这两个数中的位置是相同的,所以计算机会告诉玩家猜对了2个原创 2017-05-03 23:04:49 · 312 阅读 · 0 评论 -
hdu1016
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 o原创 2017-04-28 20:54:37 · 408 阅读 · 0 评论 -
hdu1015
=== 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. Klein safes are extremely rare; most of them, along with Klein and h原创 2017-04-28 21:05:21 · 526 阅读 · 0 评论 -
hdu1010
The 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 realized that the bone原创 2017-04-28 21:09:56 · 477 阅读 · 0 评论 -
hdu1035
Problem DescriptionA 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原创 2017-05-01 13:09:00 · 211 阅读 · 0 评论 -
hdu1045
Problem DescriptionSuppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.A blockh原创 2017-05-02 16:47:20 · 148 阅读 · 0 评论 -
hdu1789 简单贪心算法
题目大意题目的意思 就是给出一个人接下来几个任务的 最后期限和不完成这些任务所扣除的分数让你编写代码 求出扣除最小的分数可以用简单的贪心算法来做先用结构体存储并且自定义排序排序的准则是 先按照扣除分数的大小排序 如果扣除分数大 那就放前面 如果扣除分数相同就把天数少的放前面代码如下#include#include#include#includeu原创 2016-11-26 23:11:41 · 388 阅读 · 0 评论 -
ACM进阶之路(线段树) HDU1394 Minimum Inversion Number
The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i aj.For a given sequence of numbers a1, a2, ..., an, if we move the first m >= 0 numb原创 2016-09-13 09:52:45 · 288 阅读 · 0 评论 -
hdu1312
Problem DescriptionThere 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 adjace原创 2017-05-08 14:06:54 · 227 阅读 · 0 评论