自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Steve·Curcy

一只菜鸡的挣扎史

  • 博客(38)
  • 收藏
  • 关注

原创 HDU 1003 - Max Sum(动态规划 & 找最大价值连续子串)

Given 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,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14. Input The fir...

2018-08-28 17:19:20 132

原创 HDU-1087 - Super Jumping! Jumping! Jumping!(dp & 求子串)

Nowadays, 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 you now. The game c...

2018-08-28 13:55:44 88

原创 POJ - 3278(or HDU 2717)Catch That Cow(BFS)

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 ≤ 100,0...

2018-08-28 08:25:48 129

原创 POJ - 1182 - 食物链(种类并查集)

动物王国中有三类动物A,B,C,这三类动物的食物链构成了有趣的环形。A吃B, B吃C,C吃A。 现有N个动物,以1-N编号。每个动物都是A,B,C中的一种,但是我们并不知道它到底是哪一种。 有人用两种说法对这N个动物所构成的食物链关系进行描述: 第一种说法是”1 X Y”,表示X和Y是同类。 第二种说法是”2 X Y”,表示X吃Y。 此人对N个动物,用上述两种说法,一句接一句地说...

2018-08-26 09:27:43 121

原创 HDU - 1022 - Train Problem I(栈的应用)

As the new term comes, the Ignatius Train Station is very busy nowadays. A lot of student want to get back to school by train(because the trains in the Ignatius Train Station is the fastest all over t...

2018-08-23 23:50:47 142

原创 CodeForces - 853A - Planning(C++ 优先队列)

CodeForces - 853A - PlanningHelen works in Metropolis airport. She is responsible for creating a departure schedule. There are n flights that must depart today, the i-th of them is planned to depart...

2018-08-23 23:02:40 289

转载 vector C++(一)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/sangyongjia/article/details/51122965       &nb...

2018-08-23 08:40:14 118

转载 博文转载

前言  对于喜欢逛CSDN的人来说,看别人的博客确实能够对自己有不小的提高,有时候看到特别好的博客想转载下载,但是不能一个字一个字的敲了,这时候我...

2018-08-23 08:23:52 125

原创 基础算法_N皇后问题(回溯法 dfs)

DescriptionN后问题在N×N的棋盘上放置N个皇后而彼此不受攻击(即在棋盘的任一行、任一列和任一对角线上不能放置两个皇后),编程求解所有的摆放方法。Input 第一行为测试数据组数T接下来T行,每行一个整数n(1<=n<=10)Output 输出T行为每行为相应的方案数Sample Input 1 1 Sample Output 1这个题目...

2018-08-22 08:43:42 625

原创 HDU - 1213 - How Many Tables(并查集)

HDU - 1213 - How Many TablesToday is Ignatius’ birthday. He invites a lot of friends. Now it’s dinner time. Ignatius wants to know how many tables he needs at least. You have to notice that not all ...

2018-08-19 22:04:44 124

原创 HDU - 1172 - 猜数字(枚举)

HDU - 1172 - 猜数字猜数字游戏是gameboy最喜欢的游戏之一。游戏的规则是这样的:计算机随机产生一个四位数,然后玩家猜这个四位数是什么。每猜一个数,计算机都会告诉玩家猜对几个数字,其中有几个数字在正确的位置上。 比如计算机随机产生的数字为1122。如果玩家猜1234,因为1,2这两个数字同时存在于这两个数中,而且1在这两个数中的位置是相同的,所以计算机会告诉玩家猜对了2个数字...

2018-08-19 11:32:37 530

原创 CodeForces - 632C - The Smallest String Concatenation(思维)

CodeForces - 632C - The Smallest String ConcatenationYou’re given a list of n strings a1, a2, …, an. You’d like to concatenate them together in some order such that the resulting string would be lex...

2018-08-18 21:43:08 189

原创 HDU - 2089 - 不要62(暴力枚举)

HDU - 2089 - 不要62杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。 杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。 不吉利的数字为所有含有4或62的号码。例如: 62315 73418 88914 都属于不吉利号码。但是,61152虽然含有...

2018-08-18 21:29:33 547

原创 POJ - 3254 - Corn Fields(dp & 状压)

POJ - 3254 - Corn FieldsFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M ≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number...

2018-08-18 21:14:43 109

原创 POJ - 1185 - 炮兵阵地(dp & 状压)

POJ - 1185 - 炮兵阵地司令部的将军们打算在N*M的网格地图上部署他们的炮兵部队。一个N*M的地图由N行M列组成,地图的每一格可能是山地(用”H” 表示),也可能是平原(用”P”表示),如下图。在每一格平原地形上最多可以布置一支炮兵部队(山地上不能够部署炮兵部队);一支炮兵部队在地图上的攻击范围如图中黑色区域所示: 如果在地图中的灰色所标识的平原上部署一支炮兵部队,则图中的黑...

2018-08-18 11:49:10 195

原创 POJ - 1276 - Cash Machine(多重背包)

POJ - 1276 - Cash MachineA Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a requested cash amount. The machine uses exactly N distinct bi...

2018-08-17 00:12:49 242

原创 HDU - 2602 - Bone Collector(01背包)

HDU - 2602 - Bone CollectorMany 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 th...

2018-08-16 23:31:57 126

原创 HDU - 2546 - 饭卡(01背包)

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

2018-08-16 17:33:38 139

原创 POJ - 2533 - Longest Ordered Subsequence (dp & 最长子串)

POJ - 2533 - Longest Ordered SubsequencePOJ - 2533 - Longest Ordered Subsequence A numeric sequence of ai is ordered if a1 < a2 < … < aN. Let the subsequence of the given numeric sequence ...

2018-08-16 17:21:58 157

原创 POJ - 1458 - Common Subsequence(dp & 公共子串)

POJ - 1458 - Common SubsequenceA subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, …, xm > another sequence Z = ...

2018-08-16 16:53:58 121

原创 HDU - 1257 - 最少拦截系统(dp & 找子串)

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

2018-08-16 16:24:01 135

原创 HDU - 1087 - Super Jumping! Jumping! Jumping!(dp & 寻找价值最大的子串)

HDU - 1087 - Super Jumping! Jumping! Jumping!Nowadays, 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 gam...

2018-08-16 15:45:01 231

原创 HDU - 2795 - Billboard(线段树 & 思维)

HDU - 2795 - BillboardAt the entrance to the university, there is a huge rectangular billboard of size h*w (h is its height and w is its width). The board is the place where all possible announcemen...

2018-08-12 13:58:28 144

原创 51Nod - 1065 - 最小正子段和(线段树 & 贪心)

51Nod - 1065 - 最小正子段和N个整数组成的序列a11,a22,a33,…,ann,从中选出一个子序列(aii,ai+1i+1,…ajj),使这个子序列的和>0,并且这个和是所有和>0的子序列中最小的。 例如:4,-1,5,-2,-1,2,6,-2。-1,5,-2,-1,序列和为1,是最小的。 Input 第1行:整数序列的长度N(2 <= N <= ...

2018-08-12 10:39:36 312

原创 CodeForces - 949A - Zebras(思维)

CodeForces - 949A - ZebrasOleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad d...

2018-08-12 08:31:19 194

原创 HDU - 4217 - Data Structure?(线段树)

HDU - 4217 - Data Structure?Data structure is one of the basic skills for Computer Science students, which is a particular way of storing and organizing data in a computer so that it can be used eff...

2018-08-11 11:12:47 141

原创 HDU - 5775 - Bubble Sort(树状数组 & 线段树 & 逆序 & 思维)

HDU - 5775 - Bubble SortBubble SortP is a permutation of the integers from 1 to N(index starting from 1). Here is the code of Bubble Sort in C++. for(int i=1;i<=N;++i) for(int j=N,t;...

2018-08-11 10:12:33 132

原创 OpenJ_Bailian - Mayor's posters(线段树 & 离散化)

OpenJ_Bailian - Mayor’s postersThe citizens of Bytetown, AB, could not stand that the candidates in the mayoral election campaign have been placing their electoral posters at all places at their whi...

2018-08-10 21:48:16 121

原创 HDU - 6182 - A Math Problem (枚举 & 打表)

HDU - 6182 - A Math ProblemYou are given a positive integer n, please count how many positive integers k satisfy kk≤nkk≤n. Input There are no more than 50 test cases. Each case only contains a ...

2018-08-10 21:11:22 259

原创 51Nod - 1279 - 扔盘子(思维题)

51Nod - 1279 - 扔盘子有一口井,井的高度为N,每隔1个单位它的宽度有变化。现在从井口往下面扔圆盘,如果圆盘的宽度大于井在某个高度的宽度,则圆盘被卡住(恰好等于的话会下去)。 盘子有几种命运:1、掉到井底。2、被卡住。3、落到别的盘子上方。 盘子的高度也是单位高度。给定井的宽度和每个盘子的宽度,求最终落到井内的盘子数量。如图井和盘子信息如下: 井:5 6 4 3 6 ...

2018-08-10 20:31:31 486

原创 OpenJ_Bailian - 2299 - Ultra-QuickSort (树状数组 & 线段树 & 求逆序数)

OpenJ_Bailian - 2299 - Ultra-QuickSortIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence...

2018-08-10 10:18:40 529

原创 HDU - 1698 - Just a Hook(线段树基础)

HDU - 1698 - Just a HookIn the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecutive metallic sticks which are of the...

2018-08-09 17:03:30 649

原创 HDU - 1754 - I Hate It(线段树基础)

HDU - 1754 - I Hate It很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input 本题目包含多组测试,请处理到文件结束。 在每个测试的第一行,有两个正整数 N 和 M ( 0 ...

2018-08-09 16:40:08 172

原创 HDU - 1166 - 敌兵布阵(线段树基础操作)

HDU - 1166 - 敌兵布阵C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生变动,可能增加或减少若干人手,但这些都逃不过C国的监视。 ...

2018-08-09 16:24:20 1564

原创 HDU - 6290 - travel (原题目:奢侈的旅行)(最短路 & 条件判断)

HDU - 6290 - travel (原题目:奢侈的旅行)高玩小Q不仅喜欢玩寻宝游戏,还喜欢一款升级养成类游戏。在这个游戏的世界地图中一共有nn个城镇,编号依次为11到nn。 这些城镇之间有mm条单向道路,第ii 条单项道路包含四个参数ui,vi,ai,biui,vi,ai,bi,表示一条从uiui号城镇出发,在vivi号城镇结束的单向道路,因为是单向道路,这不意味着小Q可以从viv...

2018-08-05 12:19:31 418

原创 HDU - 1535 - Invitation Cards (spfa & 双向遍历)

HDU - 1535 - Invitation CardsIn the age of television, not many people attend theater performances. Antique Comedians of Malidinesia are aware of this fact. They want to propagate theater and, most ...

2018-08-04 10:49:31 191

原创 Caterpillar (图论 & 思维)

CaterpillarAn undirected graph is called a caterpillar if it is connected, has no cycles, and there is a path in the graph where every node is either on this path or a neighbor of a node on the path...

2018-08-03 11:21:36 953

原创 MPI Maelstrom(最短路,Dijkstra)

MPI MaelstromBIT has recently taken delivery of their new supercomputer, a 32 processor Apollo Odyssey distributed shared memory machine with a hierarchical communication subsystem. Valentine McKee’...

2018-08-01 09:39:18 122

空空如也

空空如也

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

TA关注的人

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