自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(69)
  • 收藏
  • 关注

原创 hdoj5480 Conturbatio(思维)

Problem DescriptionThere are many rook on a chessboard, a rook can attack the row and column it belongs, including its own place.There are also many queries, each query gives a rectangle on th

2016-08-22 20:34:49 338

原创 CodeForces 660ACo-prime Array

DescriptionYou are given an array of n elements, you must make it a co-prime array in as few moves as possible.In each move you can insert any positive integral number you want not greater than 

2016-08-22 20:20:01 258

原创 hdoj1087Super Jumping! Jumping! Jumping!(上升序列求最大和)

Problem DescriptionNowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to

2016-08-18 20:59:48 228

原创 hdoj5256序列变换(LIS变形)

Problem Description我们有一个数列A1,A2...An,你现在要求修改数量最少的元素,使得这个数列严格递增。其中无论是修改前还是修改后,每个元素都必须是整数。请输出最少需要修改多少个元素。 Input第一行输入一个T(1≤T≤10),表示有多少组数据每一组数据:第一行输入一个N(1≤N≤105),表示数列的长度第二行

2016-08-18 20:50:55 322

原创 hdoj1257最少拦截系统

Problem Description某国为了防御敌国的导弹袭击,发展出一种导弹拦截系统.但是这种导弹拦截系统有一个缺陷:虽然它的第一发炮弹能够到达任意的高度,但是以后每一发炮弹都不能超过前一发的高度.某天,雷达捕捉到敌国的导弹来袭.由于该系统还在试用阶段,所以只有一套系统,因此有可能不能拦截所有的导弹.怎么办呢?多搞几套系统呗!你说说倒蛮容易,成本呢?成本是个大问题啊.所以俺就到这里

2016-08-18 18:38:11 224

原创 hdoj1025Constructing Roads In JGShining's Kingdom(LIS)

Problem DescriptionJGShining's kingdom consists of 2n(n is no more than 500,000) small cities which are located in two parallel lines.Half of these cities are rich in resource (we call them ri

2016-08-18 18:32:39 205

原创 hodj1950 Bridging signals

Problem Description'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 chi

2016-08-18 17:45:19 190

原创 zzuli oj 1919(序列分段求和)(二分)

Description晴天想把一个包含n个整数的序列a分成连续的若干段,且和最大的一段的值最小,但他有强迫症,分的段数不能超过m段,然后他就不会分了。。。他想问你这个分出来的和最大的一段的和最小值是多少?Input第一行输入一个整数t,代表有t组测试数据。每组数据第一行为两个整数n,m分别代表序列的长度和最多可分的段数。接下来一行包含n个整数表示序列。0

2016-08-18 15:27:03 625

原创 zzuli oj 1918(二分图匹配)

Description晴天也来寻宝啦,有一个m层的宝塔,只能从第一层开始一层一层的往上走,每层都有一个门,你需要用钥匙来打开门才能继续走,现在晴天有n把钥匙,编号为0-n-1,然后他要开始寻宝了。没有特殊技能怎么好意思出来寻宝呢,他现在有两个天赋技能,他知道第i层的门可以用编号为a和b的钥匙打开(可能a等于b呦),然后他还可以在进入宝塔前把门的顺序任意调换一次,也就是说比如可以把m层原来的

2016-08-17 20:30:59 299

原创 hdoj 2063 过山车(二分图匹配)

Problem DescriptionRPG girls今天和大家一起去游乐场玩,终于可以坐上梦寐以求的过山车了。可是,过山车的每一排只有两个座位,而且还有条不成文的规矩,就是每个女生必须找个个男生做partner和她同坐。但是,每个女孩都有各自的想法,举个例子把,Rabbit只愿意和XHD或PQK做partner,Grass只愿意和linle或LL做partner,PrincessSno

2016-08-17 20:25:54 358

原创 51nod最长公共子序列问题

输入第1行:字符串A第2行:字符串B(A,B的长度 输出输出最长的子序列,如果有多个,随意输出1个。输入示例abcicbaabdkscab输出示例abca代码如下:#include#include#includeusing namespace std;char

2016-08-17 19:19:25 341

原创 51nod 最大子段和

给出一个整数数组a(正负数都有),如何找出一个连续子数组(可以一个都不取,那么结果为0),使得其中的和最大?例如:-2,11,-4,13,-5,-2,和最大的子段为:11,-4,13。和为20。输入第1行:整数序列的长度N(2 <= N <= 50000)第2 - N + 1行:N个整数(-10^9 输出输出

2016-08-17 19:07:33 806 1

原创 51nod 矩阵取数问题

给定一个m行n列的矩阵,矩阵每个元素是一个正整数,你现在在左上角(第一行第一列),你需要走到右下角(第m行,第n列),每次只能朝右或者下走到相邻的位置,不能走出矩阵。走过的数的总和作为你的得分,求最大的得分。输入第1行:N,N为矩阵的大小。(2 第2 - N + 1行:每行N个数,中间用空格隔开,对应格子中奖励的价值。(1 输出输出能

2016-08-17 19:01:56 1151

原创 hdoj1711(KMP模板题)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] =

2016-08-16 20:10:29 1028

原创 light oj 1058(数学)

DescriptionThere are n distinct points in the plane, given by their integer coordinates. Find the number of parallelograms whose vertices lie on these points. In other words, find the number of 4-

2016-08-15 18:08:10 329

原创 CodeForces 510B B. Fox And Two Dots

Fox Ciel is playing a mobile puzzle game called "Two Dots". The basic levels are played on a board of size n × m cells, like this:Each cell contains a dot that has some color. We will use diff

2016-08-15 18:00:26 360

原创 UVA 10200 Prime Tim

Euler is a well-known matematician, and, among many other things, he discovered that the formulan2 + n + 41 produces a prime for 0 ≤ n < 40. For n = 40, the formula produces 1681, which is 41 ∗ 41.Eve

2016-08-15 17:54:28 301

原创 hdoj5748 Bellovin 【BestCoder Round #84】 (最长上升序列)

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 length of the longest increasing subsequence

2016-08-12 20:41:39 254

原创 POJ1065Wooden Sticks(最小上升序列)

DescriptionThere is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs som

2016-08-12 18:26:32 443

原创 hdoj1159Common Subsequence(LCS 最长公共子序列)

Problem DescriptionA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = another sequence Z = is a subsequence of X if there e

2016-08-12 16:53:15 268

原创 Codeforces Round #367 (Div. 2) B - Interesting drink

Vasiliy likes to rest after a hard work, so you may often meet him in some bar nearby. As all programmers do, he loves the famous drink "Beecola", which can be bought in n different shops in the cit

2016-08-12 15:57:20 221

原创 Codeforces Round #367 (Div. 2)ABeru-taxi

Vasiliy lives at point (a, b) of the coordinate plane. He is hurrying up to work so he wants to get out of his house as soon as possible. New app suggested n available Beru-taxi nearby. The i-th t

2016-08-12 12:13:02 249

原创 hdoj2066一个人的旅行(jijkstra)

Problem Description虽然草儿是个路痴(就是在杭电待了一年多,居然还会在校园里迷路的人,汗~),但是草儿仍然很喜欢旅行,因为在旅途中 会遇见很多人(白马王子,^0^),很多事,还能丰富自己的阅历,还可以看美丽的风景……草儿想去很多地方,她想要去东京铁塔看夜景,去威尼斯看电影,去阳明山上看海芋,去纽约纯粹看雪景,去巴黎喝咖啡写信,去北京探望孟姜女……眼看寒假就快到了,这么一大

2016-08-12 11:40:37 290

原创 hdoj1203I NEED A OFFER!(01背包变形)

Problem DescriptionSpeakless很早就想出国,现在他已经考完了所有需要的考试,准备了所有要准备的材料,于是,便需要去申请学校了。要申请国外的任何大学,你都要交纳一定的申请费用,这可是很惊人的。Speakless没有多少钱,总共只攒了n万美元。他将在m个学校中选择若干的(当然要在他的经济承受范围内)。每个学校都有不同的申请费用a(万美元),并且Speakless估计了

2016-08-11 21:24:50 247

原创 hdoj3466Proud Merchants(排序+01背包)

Problem DescriptionRecently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the people in this country are still ver

2016-08-11 19:08:44 265

原创 hdoj2602Bone 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 grav

2016-08-11 17:42:00 827

原创 hdoj2546饭卡(背包01)

Problem Description电子科大本部食堂的饭卡有一种很诡异的设计,即在购买之前判断余额。如果购买一个商品之前,卡上的剩余金额大于或等于5元,就一定可以购买成功(即使购买后卡上余额为负),否则无法购买(即使金额足够)。所以大家都希望尽量使卡上的余额最少。某天,食堂中有n种菜出售,每种菜可购买一次。已知每种菜的价格以及卡上的余额,问最少可使卡上的余额为多少。 

2016-08-11 17:38:23 382

原创 CodeForces 659A Round House(技巧)

Vasya lives in a round building, whose entrances are numbered sequentially by integers from 1 to n. Entrance n and entrance 1 are adjacent.Today Vasya got bored and decided to take a walk in t

2016-08-11 11:37:50 274

原创 Codeforces 557B Pasha and Tea (思维)

Pasha decided to invite his friends to a tea party. For that occasion, he has a large teapot with the capacity of w milliliters and 2n tea cups, each cup is for one of Pasha's friends. The i-th cup

2016-08-11 10:35:05 453

原创 hdoj 【BestCoder Round #81 (div.2)】 5670 Machine

Problem DescriptionThere is a machine with m(2≤m≤30) coloured bulbs and a button.When the button is pushed, the rightmost bulb changes.For any changed bulb,if it is red now it will be gree

2016-08-11 09:12:59 224

原创 zzulioj1908小火山的围棋梦想(dfs+技巧)

Description  小火山最近喜欢上了围棋。  对于围棋,其实小火山是一窍不通的。现在棋盘上,有很多小火山的棋子。 如果棋盘上有这样的一个位置, 那么这个位置也会变成小火山的棋子;这样的位置是指小火山的棋子将该位置围起来。  现在,小火山想知道实际棋盘是什么样子的。 你快来帮帮他吧!Input输入第一行是一个整数T(T 每组数据,第一行为两个整数n

2016-08-10 20:05:24 379

原创 zzulioj 1905小火山的跳子游戏(最大公约数)

Description  小火山和火山火山在一块玩跳子游戏。规则如下:  1:跳子的起始位置为0,棋盘大小从1到N  2:每次跳子跳k步。 例如当前位置为i, 那么下一步为i + k  3:跳子过程中,碰到1或N则往回跳。例如当前位置为4, N = 6, K = 5的时候, 那么下次跳子, 应该是 5, 6, 5 ,4, 3。最后落在3的位置, 再一次跳子为2 1 2

2016-08-10 19:44:26 299

原创 hdoj1260Tickets

Problem DescriptionJesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he g

2016-08-09 21:16:52 206

原创 hdoj1559最大子矩阵

Problem Description给你一个m×n的整数矩阵,在上面找一个x×y的子矩阵,使子矩阵中所有元素的和最大。 Input输入数据的第一行为一个正整数T,表示有T组测试数据。每一组测试数据的第一行为四个正整数m,n,x,y(0 Output对于每组数据,输出一个整数,表示子矩阵的最大和。 Sample I

2016-08-09 20:59:37 448 1

原创 poj1745Divisibility

DescriptionConsider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressions that evaluate to different

2016-08-09 20:31:31 301

原创 hdoj1466计算直线的交点数(经典dp)

Problem Description平面上有n条直线,且无三线共点,问这些直线能有多少种不同交点数。比如,如果n=2,则可能的交点数量为0(平行)或者1(不平行)。 Input输入数据包含多个测试实例,每个测试实例占一行,每行包含一个正整数n(n Output每个测试实例对应一行输出,从小到大列出所有相交方案,其中每个数为可

2016-08-09 20:17:01 373

原创 hdoj5806 NanoApe Loves Sequence Ⅱ(尺取法)

Problem DescriptionNanoApe, the Retired Dog, has returned back to prepare for for the National Higher Education Entrance Examination!In math class, NanoApe picked up sequences once again. He w

2016-08-09 11:12:47 260

原创 hdoj1176免费馅饼(DP)

Problem Description都说天上不会掉馅饼,但有一天gameboy正走在回家的小径上,忽然天上掉下大把大把的馅饼。说来gameboy的人品实在是太好了,这馅饼别处都不掉,就掉落在他身旁的10米范围内。馅饼如果掉在了地上当然就不能吃了,所以gameboy马上卸下身上的背包去接。但由于小径两侧都不能站人,所以他只能在小径上接。由于gameboy平时老呆在房间里玩游戏,虽然在游戏中

2016-08-08 21:31:15 210

原创 HDU5804 BestCoder Round 86A 【Price List】

问题描述在Byteland一共有nn家商店,编号依次为11到nn。每家商店只会卖一种物品,其中第ii家商店的物品单价为v_iv​i​​。Byteasar每天都会进行一次购物,他会在每家商店购买最多一件物品,当然他也可以选择什么都不买。回家之后,Byteasar会把这一天购物所花的钱的总数记录在账本上。Byteasar的数学不好,他可能会把花的钱记少,也可能记多。Byteasar并不介意

2016-08-08 19:57:30 268

原创 hdoj1231最大连续子序列(DP)

Problem Description给定K个整数的序列{ N1, N2, ..., NK },其任意连续子序列可表示为{ Ni, Ni+1, ..., Nj },其中 1 例如给定序列{ -2, 11, -4, 13, -5, -2 },其最大连续子序列为{ 11, -4, 13 },最大和 为20。 在今年的数据结构考卷中,要求编写程序得到最大和,现在增加一个要求,即还

2016-08-08 19:48:59 532

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除