自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 HDU 1501 排列2(枚举)

Problem DescriptionRay又对数字的列产生了兴趣:现有四张卡片,用这四张卡片能排列出很多不同的4位数,要求按从小到大的顺序输出这些4位数。 Input每组数据占一行,代表四张卡片上的数字(0 Output对每组卡片按从小到大的顺序输出所有能由这四张卡片组成的4位数,千位数字相同的在同一行,同一行中每个四位

2017-03-23 20:53:54 405

原创 NYOJ 211 tree(二叉树的遍历与创建)

B - Tree RecoveryTime Limit:1000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64uSubmit StatusDescriptionLittle Valentine liked playing with binary trees very much. H

2017-03-23 20:44:14 597

原创 HDU 1501 Zipper (DFS)

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9922    Accepted Submission(s): 3553Problem DescriptionGiven three strings, you ar

2017-03-23 20:36:36 283

原创 快排原理

举例 :用快速排序将 6 1 2 7 9 3 4 5 10 8这个序列排序。思路:      首先在这个序列中选择一个基准数(一个用来参照的数).,一般情况下选择左边第一个数作为基准数,接下来首先要做的就是将这个序列中所有大于基准数的元素放在基准数之后,将所有小于基准数的元素放在基准数之前,这样就可以得到  3 1 2 5 4 6 9 7 10 8这个序列,所以从这个变化后的序列可以看出,

2017-03-09 20:27:24 2840

原创 hdoj2824 The Euler function(欧拉函数)

Problem DescriptionThe Euler function phi is an important kind of function in number theory, (n) represents the amount of the numbers which are smaller than n and coprime to n, and this function h

2017-03-07 18:29:11 295

原创 POJ 3187 (DFS)

DescriptionFJ and his cows enjoy playing a mental game. They write down the numbers from 1 to N (1 <= N <= 10) in a certain order and then sum adjacent numbers to produce a new list with one few

2017-03-06 21:54:29 267

原创 hdoj 1568 (斐波那契数列+数学)

Problem Description2007年到来了。经过2006年一年的修炼,数学神童zouyu终于把0到100000000的Fibonacci数列(f[0]=0,f[1]=1;f[i] = f[i-1]+f[i-2](i>=2))的值全部给背了下来。接下来,CodeStar决定要考考他,于是每问他一个数字,他就要把答案说出来,不过有的数字太长了。所以规定超过4位的只要说出前4位就

2016-11-12 20:30:28 736

原创 HDU 5944 Fxx and string(数学)

问题描述青年理论计算机科学家Fxx得到了一个只包含小写字母的字符串。字符串的长度为\:nn,下标从1开始,第\:i\:i位的字母为\:s_is​i​​,现在Fxx想知道有多少三元组\:(i,j,k)\:(i,j,k)满足下列条件1、i,j,k\:i,j,k三个数成等比数列2、s_i=s​i​​='yy',s_j=,s​j​​='rr',s_k=,s​k​​='xx'3.i/ji

2016-10-31 13:42:43 335

原创 POJ3624 Charm Bracelet

Time Limit: 1000MS Memory Limit: 65536KTotal Submissions: 34471 Accepted: 15268DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course,

2016-10-10 22:23:44 231

原创 hdoj1847(巴什博弈)

Problem Description大学英语四级考试就要来临了,你是不是在紧张的复习?也许紧张得连短学期的ACM都没工夫练习了,反正我知道的Kiki和Cici都是如此。当然,作为在考场浸润了十几载的当代大学生,Kiki和Cici更懂得考前的放松,所谓“张弛有道”就是这个意思。这不,Kiki和Cici在每天晚上休息之前都要玩一会儿扑克牌以放松神经。“升级”?“双扣”?“红五”?还是“斗地主

2016-10-10 20:45:27 332

原创 POJ 1942 Paths on a Grid(数学组合)

DescriptionImagine you are attending your math lesson at school. Once again, you are bored because your teacher tells things that you already mastered years ago (this time he's explaining that (a+

2016-10-10 20:21:51 318

原创 hdoj 2601 An easy problem(数学)

Problem DescriptionWhen Teddy was a child , he was always thinking about some simple math problems ,such as “What it’s 1 cup of water plus 1 pile of dough ..” , “100 yuan buy 100 pig” .etc..On

2016-10-10 19:17:01 339

原创 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 339

原创 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 259

原创 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 230

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

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

2016-08-18 20:50:55 323

原创 hdoj1257最少拦截系统

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

2016-08-18 18:38:11 225

原创 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 207

原创 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 191

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

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

2016-08-18 15:27:03 628

原创 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 360

原创 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 809 1

原创 51nod 矩阵取数问题

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

2016-08-17 19:01:56 1187

原创 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 1030

原创 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 361

原创 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 303

原创 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 271

原创 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 225

原创 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 250

原创 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 250

原创 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 268

原创 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 828

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

空空如也

空空如也

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

TA关注的人

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