自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

楚江枫

不忘初心,方得始终

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

原创 【LightOJ 1136】

Description There is sequence 1, 12, 123, 1234, …, 12345678910, … . Now you are given two integers A and B, you have to find the number of integers from Ath number to Bth (inclusive) number, which are

2016-08-26 09:03:07 949

原创 【LightOJ 1331 】

LightOJ 1331 Description Agent J is preparing to steal an antique diamond piece from a museum. As it is fully guarded and they are guarding it using high technologies, it’s not easy to steal the pi

2016-08-26 08:58:57 710

原创 【LightOJ 1305】

Description A parallelogram is a quadrilateral with two pairs of parallel sides. See the picture below:Fig: a parallelogramNow you are given the co ordinates of A, B and C, you have to find the coordi

2016-08-26 08:53:01 356

原创 【HDU 5100 Chessboard 】

ChessboardProblem Description Consider the problem of tiling an n×n chessboard by polyomino pieces that are k×1 in size; Every one of the k pieces of each polyomino tile must align exactly with one of

2016-08-25 10:31:47 445

原创 【HDU 5512 Pagodas】

PagodasProblem Description n pagodas were standing erect in Hong Jue Si between the Niushou Mountain and the Yuntai Mountain, labelled from 1 to n. However, only two of them (labelled a and b, where 1

2016-08-25 09:51:18 441

原创 【POJ 1383 Labyrinth】

LabyrinthDescriptionThe northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either filled by rock, or free. There is

2016-08-24 21:45:28 387

原创 【HDU 1599 find the mincost route 】

find the mincost routeProblem Description 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,….VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。I

2016-08-24 21:41:42 281

原创 【HDU 5253 连接的管道】

连接的管道Problem Description 老 Jack 有一片农田,以往几年都是靠天吃饭的。但是今年老天格外的不开眼,大旱。所以老 Jack 决定用管道将他的所有相邻的农田全部都串联起来,这样他就可以从远处引水过来进行灌溉了。当老 Jack 买完所有铺设在每块农田内部的管道的时候,老 Jack 遇到了新的难题,因为每一块农田的地势高度都不同,所以要想将两块农田的管道链接,老 Jack 就需

2016-08-24 21:36:20 445

原创 【HDU 1599 find the mincost route】

find the mincost routeProblem Description 杭州有N个景区,景区之间有一些双向的路来连接,现在8600想找一条旅游路线,这个路线从A点出发并且最后回到A点,假设经过的路线为V1,V2,….VK,V1,那么必须满足K>2,就是说至除了出发点以外至少要经过2个其他不同的景区,而且不能重复经过同一个景区。现在8600需要你帮他找一条这样的路线,并且花费越少越好。I

2016-08-24 10:16:22 439

原创 【CodeForces 597A Divisibility】

DivisibilityFind the number of k-divisible numbers on the segment [a, b]. In other words you need to find the number of such integer values x that a ≤ x ≤ b and x is divisible by k.Input The only line

2016-08-23 22:31:08 395

原创 【CodeForces 598A Tricky Sum】

Tricky Sum In this problem you are to calculate the sum of all integers from 1 to n, but you should take all powers of two with minus in the sum.For example, for n = 4 the sum is equal to  - 1 - 2 + 3

2016-08-23 22:28:32 342

原创 【LightOJ 1294 Positive Negative Sign】

Positive Negative SignGiven two integers: n and m and n is divisible by 2m, you have to write down the first n natural numbers in the following form. At first take first m integers and make their sign

2016-08-23 21:59:43 326

原创 【LightOJ 1008 Fibsieve`s Fantabulous Birthday】

Fibsieve had a fantabulous (yes, it’s an actual word) birthday party this year. He had so many gifts that he was actually thinking of not having a party next year.Among these gifts there was an N x N g

2016-08-23 21:58:38 324

原创 【LightOJ 1043 Triangle Partitioning】

Triangle Partitioning See the picture below.You are given AB, AC and BC. DE is parallel to BC. You are also given the area ratio between ADE and BDEC. You have to find the value of AD.Input Input sta

2016-08-23 21:55:26 407

原创 【LightOJ 1138 Trailing Zeroes (III)】

Trailing Zeroes (III) You task is to find minimal natural number N, so that N! contains exactly Q zeroes on the trail in decimal notation. As you know N! = 1*2*…*N. For example, 5! = 120, 120 contains

2016-08-23 21:51:06 438

原创 【LightOJ 1045 Digits of Factorial】

Digits of Factorialactorial of an integer is defined by the following functionf(0) = 1 f(n) = f(n - 1) * n, if(n > 0)So, factorial of 5 is 120. But in different bases, the factorial may be different.

2016-08-23 21:45:15 374

原创 【Lightoj 1282 Leading and Trailing】

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.Input Input starts with an integer T (≤ 1000),

2016-08-23 21:34:12 372

原创 【POJ 1852 ANTS】

DescriptionAn army of ants walk on a horizontal pole of length l cm, each with a constant speed of 1 cm/s. When a walking ant reaches an end of the pole, it immediatelly falls off it. When two ants mee

2016-08-23 12:05:11 460

原创 【HDU 1059 Dividing 多重背包 】

DividingProblem Description Marsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would be easy if al

2016-08-22 21:49:26 329

原创 【codeforces 366A Dima and Guards】

Dima and GuardsDescription Nothing has changed since the last round. Dima and Inna still love each other and want to be together. They’ve made a deal with Seryozha and now they need to make a deal wit

2016-08-22 20:23:36 308

原创 【codeforces 653 A Bear and Three Balls】

Bear and Three BallsDescription Limak is a little polar bear. He has n balls, the i-th ball has size ti.Limak wants to give one ball to each of his three friends. Giving gifts isn’t easy — there are t

2016-08-22 20:21:43 346

原创 【codeforces 658A Bear and Reverse Radewoosh】

Bear and Reverse RadewooshDescription Limak and Radewoosh are going to compete against each other in the upcoming algorithmic contest. They are equally skilled but they won’t solve problems in the sam

2016-08-22 20:19:54 320

原创 【codeforces 554B Ohana Cleans Up】

Ohana Cleans UpDescription Ohana Matsumae is trying to clean a room, which is divided up into an n by n grid of squares. Each square is initially either clean or dirty. Ohana can sweep her broom over

2016-08-22 20:18:17 407

原创 【codeforces 660 A Co-prime Array】

Co-prime ArrayDescription You 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 grea

2016-08-22 20:14:53 274

原创 【codeforces 632B Alice, Bob, Two Teams】

Alice, Bob, Two TeamsDescription Alice and Bob are playing a game. The game involves splitting up game pieces into two teams. There are n pieces, and the i-th piece has a strength pi.The way to split

2016-08-22 20:09:26 419

原创 【POJ 2299 Ultra-QuickSort】

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

2016-08-22 11:57:36 284

转载 【set 详解】

1.关于setC++ STL 之所以得到广泛的赞誉,也被很多人使用,不只是提供了像vector, string, list等方便的容器,更重要的是STL封装了许多复杂的数据结构算法和大量常用数据结构操作。vector封装数组,list封装了链表,map和set封装了二叉树等,在封装这些数据结构的时候,STL按照程序员的使用习惯,以成员函数方式提供的常用操作,如:插入、排序、删除、查找等。让用户在ST

2016-08-22 11:16:27 364

转载 【c++ set 的用法】

1,set的含义是集合,它是一个有序的容器,里面的元素都是排序好的,支持插入,删除,查找等操作,就 像一个集合一样。所有的操作的都是严格在logn时间之内完成,效率非常高。 set和multiset的区别是:set插入的元素不能相同,但是multiset可以相同。 创建 multiset base; 删除:如果删除元素a,那么在定义的比较关系下和a相等的所有元素都会被删除 base.co

2016-08-22 11:12:46 1140

转载 【C++ map 的基本使用和操作】

C++ map的基本操作和使用 (2009-09-23 14:58:21)转载▼ 标签: c map 编程 基本操作 live hai it 分类: Pro.Languages Map是c++的一个标准容器,她提供了很好一对一的关系,在一些程序中建立一个map可以起到事半功倍的效果,总结了一些map基本简单实用的操作! 1. map最基本的构造函数; map < string

2016-08-22 10:59:32 314

原创 【nyoj 1291 ABS 】

描述Mr.Ha is a famous scientist .He has just not got a kind of magic medicine called Entropy Cracker.The medicine was preserved in V bottles,and the i-th (1≤i≤N) bottle contains V liters of medicine.To m

2016-08-22 10:35:35 368

原创 【codeforces 707A Brain's Photos】

Brain’s PhotosSmall, but very brave, mouse Brain was not accepted to summer school of young villains. He was upset and decided to postpone his plans of taking over the world, but to become a photograph

2016-08-22 09:59:29 539

原创 【codeforcse 707B Bakery】

Bakery Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connects some pair of cities.To bake muffins in h

2016-08-22 09:55:53 290

原创 【codeforces 707C Pythagorean Triples】

Pythagorean TriplesKatya studies in a fifth grade. Recently her class studied right triangles and the Pythagorean theorem. It appeared, that there are triples of positive integers such that you can con

2016-08-22 09:45:53 318

原创 【nyoj 1261 不是匹配 】

不是匹配描述 有N个人,N个活动, 每个人只会对2个或者3个活动感兴趣, 每个活动也只有两个人或者两个活动对它兴趣,每个人参加一个 感兴趣的活动需要一天 ,且当天该活动被参加时,其他的人不能参加 如果每个人都参加完自己有兴趣的活动,应当怎样安排使得所用总天数时间最短 2<= N <=1000, 1<=m<=1000;输入 一个数T 表示T 组数据 每组一个N表示人数,编号1 –

2016-08-20 17:27:55 367

原创 【nyoj 1291 音痴又音痴的LT 二分】

音痴又音痴的LT音痴又音痴的LT 时间限制:4000 ms | 内存限制:65535 KB 描述 LT最近一直在无限循环薛之谦的歌,简直都中毒了!可是呢…他的歌LT还是不会唱(其实不止他的歌LT不会唱,所有人的歌LT都不会唱…因为LT是标准的音痴)可是LT又很喜欢唱歌(所以LT不仅是音痴还是音痴)…没错,这对于LT的室友来说简直是噩梦… 现在呢,LT有N次操作,每次操作只会有两种

2016-08-20 17:10:49 390

原创 【HDU 1863 畅通工程】

畅通工程Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公路的若干条道路的成本。现请你编写程序,计算出全省畅通需要的最低成本。Input 测试输入包含若干测试用例。每个测试用例的第1行给出评估的道路条数 N、村庄数目M ( < 100 );

2016-08-19 21:21:58 386

转载 【尺取法】

我们先来介绍一下尺取法。尺取法,顾名思义,像尺子一样,一块一块的截取。是不是解释的有点让人纳闷~。。没关系,下面我们通过这个题目来体会尺取法的魅力。题目翻译:  给定长度为n的数列整数a0,a1,a2,a3 ….. an-1以及整数S。求出综合不小于S的连续子序列的长度的最小值。如果解不存在,则输出0。  限制条件:    10    0    S<10^8这里我们拿第一组测试数据举例子,即 n=1

2016-08-19 18:02:10 1062

原创 【zzulioj 1912 小火山的爱情密码】

小火山的爱情密码Description小火山获得了一个字符串,然而大火山让小火山从里面截取一段字符串,并且让小火山截取的字符串满足一些字符达到一定数量。 小火山觉得很容易,但是他想要知道他至少得截取多长的字符串。 Input首先是一个整数t(t<=100),表示测试数据组数。接下来是两个整数n和m(n<=10000, m<=10),n表示字符串的长度,m表示要满足一定数量的字符 的种类.(字符

2016-08-19 17:56:44 503

原创 【zzulioj 1902 985的因子对难题】

985的因子对难题Description985有n个正整数,他想知道存在多少个不同的因子对(a[i], a[j])使得 1 <= i, j <= n && i != j && a[j] % a[i] == 0,其中i和j是元素的下标。 特别地,他认为(a[i],a[j])与(a[j],a[i])是一样的因子对。 Input第一行输入一个整数t,代表有t组测试数据。 每组数据占两行,第一行输入

2016-08-19 09:37:01 376

原创 【zzulioj 1921 】

Description给定一个长度为n的数字序列a,从中选取一个长为m的子序列b满足 b[i]&b[i-1]!=0 (2<=i<=m) 求最大的m。Input第一行输入一个整数t,代表有t组测试数据。 每组数据第一行输入一个整数n代表a序列的长度,接下来一行输入n个正整数表示ai(0 < i <= n)。 1<=t<=20,0<=n<=100000,0<=ai<=1e9。Output一个整数表

2016-08-18 21:47:44 511

空空如也

空空如也

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

TA关注的人

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