自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 POJ1976 Mini Locomotive

Mini LocomotiveA train has a locomotive that pulls the train with its many passenger coaches. If the locomotive breaks down, there is no way to pull the train. Therefore, the office of railroads deci...

2019-09-10 20:59:55 227

原创 POJ 2478 Farey Sequence

Farey SequenceThe Farey Sequence Fn for any integer n with n >= 2 is the set of irreducible rational numbers a/b with 0 < a < b <= n and gcd(a,b) = 1 arranged in increasing order. The fir...

2019-09-09 20:21:46 158

原创 hdu 1867 A + B for you again(KMP)

A + B for you againGenerally speaking, there are a lot of problems about strings processing. Now you encounter another such problem. If you get two strings, such as “asdf” and “sdfg”, the result of t...

2019-08-19 19:08:41 154

原创 未完成

[Swift 算法] 马拉车算法 - Super邦的开源库详解 - SegmentFault 思否https://segmentfault.com/a/1190000006875558【POJ1182】食物链,思路+数据https://blog.csdn.net/c0de4fun/article/details/7318642)LeetCode 回文字符串算法: 动态规划算法 &amp...

2019-08-17 21:24:37 120

原创 POJ 2236【并查集】Wireless Network

Wireless NetworkAn earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all c...

2019-08-16 21:11:30 78

原创 Oulipo

void getnext(int l)//求模式串的next数组{ next[0]=-1; next[1]=0; int i=1,k=0; while(i<l) { if(k<0||s[i]==s[k]) next[++i]=++k; else k=next[k] ...

2019-08-15 22:00:25 179

原创 Lightoj 1090 - Trailing Zeroes (II)

Trailing Zeroes (II)Find the number of trailing zeroes for the following function:nCr * pqwhere n, r, p, q are given. For example, if n = 10, r = 4, p = 1, q = 1, then the number is 210 so, number ...

2019-08-13 20:59:10 204

原创 UVA11426 GCD - Extreme (II)---欧拉函数的运用

GCD - Extreme (II)Given the value of N, you will have to find the value of G. The definition of G is given below:Here GCD(i, j) means the greatest common divisor of integer i and integer j.For tho...

2019-08-12 21:30:01 184

原创 poj 1061青蛙的约会

青蛙的约会两只青蛙在网上相识了,它们聊得很开心,于是觉得很有必要见一面。它们很高兴地发现它们住在同一条纬度线上,于是它们约定各自朝西跳,直到碰面为止。可是它们出发之前忘记了一件很重要的事情,既没有问清楚对方的特征,也没有约定见面的具体位置。不过青蛙们都是很乐观的,它们觉得只要一直朝着某个方向跳下去,总能碰到对方的。但是除非这两只青蛙在同一时间跳到同一点上,不然是永远都不可能碰面的。为了帮助这两只...

2019-08-12 20:32:13 213

原创 LightOJ 1282 - Leading and Trailing (求n^k的前三位和后三位)

Leading and TrailingYou are given two integers: n and k, your task is to find the most significant three digits, and least significant three digits of nk.InputInput starts with an integer T (≤ 1000...

2019-08-11 17:34:55 95

原创 LightOj 1220Mysterious Bacteria

Mysterious BacteriaDr. Mob has just discovered a Deathly Bacteria. He named it RC-01. RC-01 has a very strange reproduction system. RC-01 lives exactly x days. Now RC-01 produces exactly p new deadly...

2019-08-11 17:21:43 111

原创 LightOJ 1197 Help Hanzo(区间素数筛选)

Help HanzoAmakusa, the evil spiritual leader has captured the beautiful princess Nakururu. The reason behind this is he had a little problem with Hanzo Hattori, the best ninja and the love of Nakurur...

2019-08-09 20:42:41 185

原创 NYOJ 221 Tree (二叉树遍历)

TreeLittle Valentine liked playing with binary trees very much. Her favorite game was constructing randomlylooking binary trees with capital letters in the nodes.This is an example of one of her cr...

2019-08-08 21:14:20 220

原创 Lower Bound-STL

Lower Bound-STL题目网址https://www.hackerrank.com/challenges/cpp-lower-bound/problemSample Input81 1 2 2 6 9 9 15414915Sample OutputYes 1No 5Yes 6Yes 8题目的大意为:第一行输出一个数字为n;第二行输出n个数字,第三行输出一个...

2019-08-06 21:57:27 525 1

原创 HDU 3999 The order of a Tree (二叉搜索树+先序遍历)

The order of a TreeAs we know,the shape of a binary search tree is greatly related to the order of keys we insert. To be precisely:insert a key k to a empty tree, then the tree become a tree witho...

2019-08-06 21:25:29 291

原创 冒泡,快速,直接插入,桶排序

算法一:冒泡排序冒泡排序的基本思想:每次比较两个相邻的元素,如果他们顺序错误把他们交换。算法步骤1)比较相邻的元素。如果第一个比第二个大,就交换他们两个。2)对每一对相邻元素作同样的工作,从开始第一对到结尾的最后一对。这步做完后,最后的元素会是最大的数。3)针对所有的元素重复以上的步骤,除了最后一个。4)持续每次对越来越少的元素重复上面的步骤,直到没有任何一对数字需要比较。void ...

2019-08-04 14:07:28 153

原创 POJ 3468 A Simple Problem with Integers(线段树区间求和)

A Simple Problem with IntegersYou have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval....

2019-08-02 21:10:05 130

原创 POJ 3264 Balanced Lineup 区间查询(两棵树求最大最小值)

Balanced LineupFor the daily milking, Farmer John’s N cows (1 ≤ N ≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the cows....

2019-08-02 19:45:52 95

原创 POJ 1511 Invitation Cards 邻接表 spfa算法

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 of all, Antiqu...

2019-08-01 21:15:19 143

原创 POJ 3259 Wormholes

WormholesWhile exploring his many farms, Farmer John has discovered a number of amazing wormholes. A wormhole is very peculiar because it is a one-way path that delivers you to its destination at a t...

2019-07-29 20:38:51 88

原创 poj 3255 Roadblocks(次短路板子题)

RoadblocksBessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home too quickly, because she likes the scenery along t...

2019-07-29 20:15:06 141

原创 HDU1548 A strange lift 奇怪的电梯(BFS+队列)

A strange liftThere is a strange lift.The lift can stop can at every floor as you want, and there is a number Ki(0 <= Ki <= N) on every floor.The lift have just two buttons: up and down.When yo...

2019-07-28 17:30:46 223

原创 hdu 1503 Advanced Fruits

Advanced FruitsThe company “21st Century Fruits” has specialized in creating new sorts of fruits by transferring genes from one fruit into the genome of another one. Most times this method doesn’t wo...

2019-07-28 17:18:02 443

原创 HDOJ 1423 Greatest Common Increasing Subsequence -- 动态规划

Greatest Common Increasing SubsequenceThis is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence.InputEach sequence is described with M - its length (1 &lt...

2019-07-26 21:00:21 87

翻译 HDU 1024 Max Sum Plus Plus

Max Sum Plus Plus**Now I think you have got an AC in Ignatius.L’s “Max Sum” problem. To be a brave ACMer, we always challenge ourselves to more difficult problems. Now you are faced with a more diffi...

2019-07-25 21:43:40 94

原创 HDU 1506 Largest Rectangle in a Histogram

Largest Rectangle in a HistogramA histogram is a polygon composed of a sequence of rectangles aligned at a common base line. The rectangles have equal widths but may have different heights. For examp...

2019-07-25 20:20:34 87

原创 HDU1978:How many ways(记忆化)

How many ways**这是一个简单的生存游戏,你控制一个机器人从一个棋盘的起始点(1,1)走到棋盘的终点(n,m)。游戏的规则描述如下:1.机器人一开始在棋盘的起始点并有起始点所标有的能量。2.机器人只能向右或者向下走,并且每走一步消耗一单位能量。3.机器人不能在原地停留。4.当机器人选择了一条可行路径后,当他走到这条路径的终点时,他将只有终点所标记的能量。如上图,机器人一开...

2019-07-22 21:22:51 151

翻译 动态规划——Poj 1159 Palindrome

PalindromeA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from right to left. You are to write a program which, given a string, determines the m...

2019-07-21 18:18:40 96

翻译 Find The Multiple(poj 1426)

Find The MultipleGiven a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains only the digits 0 and 1. You may assume that n is not greater ...

2019-07-21 18:05:10 77

原创 HDU1010 Tempter of the Bone(小狗是否能逃生----DFS)

Tempter of the BoneThe 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 rea...

2019-07-21 17:33:23 96

原创 Maximum Sum 最大子矩阵和+dp+(最大连续子序列的变形)

Maximum SumA problem that is simple to solve in one dimension is often much more difficult to solve in more than one dimension. Consider satisfying a boolean expression in conjunctive normal form in ...

2019-07-21 16:46:15 130

原创 Watering Grass

UVA 10382 Watering Grass (贪心 + 区间覆盖问题)**n sprinklers are installed in a horizontal strip of grass l meters long and w meters wide. Each sprinkler is installed at the horizontal center line of the str...

2019-07-21 16:25:18 294

原创 POJ-1011 Sticks

POJ-1011 SticksGeorge took sticks of the same length and cut them randomly until all parts became at most 50 units long. Now he wants to return sticks to the original state, but he forgot how many st...

2019-07-21 15:48:44 116

空空如也

空空如也

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

TA关注的人

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