自定义博客皮肤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)
  • 收藏
  • 关注

原创 Not simply beatiful strings (思维)

Let's call a string adorable if its letters can be realigned in such a way that they form two consequent groups of equal symbols (note that different groups must contain different symbols). For exampl...

2018-05-22 19:49:29 465

原创 Distance Queries POJ - 1986(最近公共祖先)

Farmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He therefore wants to find a path of a more reasonable length. The inp...

2018-05-21 18:49:10 219

原创 Three-level Laser (二分+贪心)

An atom of element X can exist in n distinct states with energies E1 < E2 < ... < En. Arkady wants to build a laser on this element, using a three-level scheme. Here is a simplified descripti...

2018-05-21 16:16:24 304

原创 How far away ? HDU - 2586(最近公共祖先)

There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want to go from house A to house B"? Usually it hard ...

2018-05-20 10:10:32 536

原创 Railway HDU - 3394(tarjan)

There are some locations in a park, and some of them are connected by roads. The park manger needs to build some railways along the roads, and he would like to arrange tourist routes to each circuit...

2018-05-19 11:20:04 253

原创 Hawk-and-Chicken HDU - 3639(强联通缩点)

Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk. So the teacher came up with an idea: ...

2018-05-19 09:41:55 257

原创 Minimize the error (贪心)

You are given two arrays A and B, each of size n. The error, E, between these two arrays is defined . You have to perform exactly k1 operations on array A and exactly k2 operations on array B. In one ...

2018-05-18 16:03:55 500

原创 The King’s Problem HDU - 3861(tarjan缩点+最小路径覆盖)

In the Kingdom of Silence, the king has a new problem. There are N cities in the kingdom and there are M directional roads between the cities. That means that if there is a road from u to v, you can...

2018-05-17 21:13:04 305

原创 Phalanx (DP)

Today is army day, but the servicemen are busy with the phalanx for the celebration of the 60th anniversary of the PRC. A phalanx is a matrix of size n*n, each element is a character (a~z or A~Z), ...

2018-05-17 18:39:41 336

原创 FatMouse's Speed

FatMouse believes that the fatter a mouse is, the faster it runs. To disprove this, you want to take the data on a collection of mice and put as large a subset of this data as possible into a sequen...

2018-05-17 17:07:57 1249

转载 Doing Homework (DP)

Ignatius has just come back school from the 30th ACM/ICPC. Now he has a lot of homework to do. Every teacher gives him a deadline of handing in the homework. If Ignatius hands in the homework after ...

2018-05-17 16:41:16 294

原创 Lecture Sleep (前缀和)

Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.Mishka is really interested in calculus, though it is so ha...

2018-05-17 09:53:16 409

原创 Lecture Sleep (前缀和)

Your friend Mishka and you attend a calculus lecture. Lecture lasts n minutes. Lecturer tells ai theorems during the i-th minute.Mishka is really interested in calculus, th...

2018-05-17 09:43:13 221

原创 Students in Railway Carriage (贪心)

There are n consecutive seat places in a railway carriage. Each place is either empty or occupied by a passenger.The university team for the Olympiad consists of a student-programmers and b student-at...

2018-05-16 21:19:19 294

原创 Summer Holiday (tarjan缩点)

To see a World in a Grain of Sand And a Heaven in a Wild Flower, Hold Infinity in the palm of your hand And Eternity in an hour.                   —— William Blake 听说lcy帮大家预定了新马泰7日游,Wiskey真是高兴的...

2018-05-15 19:23:40 128

原创 Destruction of a Tree (贪心)

You are given a tree (a graph with n vertices and n - 1 edges in which it's possible to reach any vertex from any other vertex using only its edges).A vertex can be destroyed if this vertex has even d...

2018-05-15 18:08:03 204

原创 Messages (贪心)

There are n incoming messages for Vasya. The i-th message is going to be received after ti minutes. Each message has a cost, which equals to A initially. After being received, the cost of a message de...

2018-05-14 19:25:32 261

原创 Battleship

Arkady is playing Battleship. The rules of this game aren't really important.There is a field of n×n cells. There should be exactly one k-decker on the field, i. e. a ship that is k cells long oriente...

2018-05-12 10:40:46 1007

原创 D. Divide by three, multiply by two(思维)

Polycarp likes to play with numbers. He takes some integer number x, writes it down on the board, and then performs with it n−1 operations of the two kinds: divide the number x by 3 (x must be divisi...

2018-05-10 19:26:04 491

原创 Watering System (贪心)

Arkady wants to water his only flower. Unfortunately, he has a very poor watering system that was designed for nn flowers and so it looks like a pipe with nn holes. Arkady can only use the water that ...

2018-05-10 15:36:25 307

原创 Mancala (模拟)

Mancala is a game famous in the Middle East. It is played on a board that consists of 14 holes. Initially, each hole has ai stones. When a player makes a move, he chooses a hole which contains a pos...

2018-05-09 21:41:03 747

原创 Less or Equal(思维)

You are given a sequence of integers of length n and integer number k. You should print any integer number x in the range of [1;109] (i.e. 1≤x≤109) such that exactly k elements of given sequence are l...

2018-05-08 21:33:24 1663

原创 977A Wrong Subtraction(模拟)

Little girl Tanya is learning how to decrease a number by one, but she does it wrong with a number consisting of two or more digits. Tanya subtracts one from a number by the following algorithm: if th...

2018-05-08 20:58:49 743

原创 Shuffle'm Up (模拟)

A common pastime for poker players at a poker table is to shuffle stacks of chips. Shuffling chips is performed by starting with two stacks of poker chips, S1 and S2, each stack containin...

2018-05-08 19:34:17 201

原创 Lara Croft and the New Game (模拟+思维)

You might have heard about the next game in Lara Croft series coming out this year. You also might have watched its trailer. Though you definitely missed the main idea about its plot, so let me lift t...

2018-05-08 17:01:04 569

原创 Fliptile (翻转问题)

Farmer John knows that an intellectually satisfied cow is a happy cow who will give more milk. He has arranged a brainy activity for cows in which they manipulate an M × N grid (1 ≤ M ≤ 1...

2018-05-07 19:26:32 231

原创 Two-gram (思维)

Two-gram is an ordered pair (i.e. string of length two) of capital Latin letters. For example, "AZ", "AA", "ZA" — three distinct two-grams.You are given a string s consisting of n capital Latin letter...

2018-05-07 17:57:03 1532

原创 Parity check

Problem DescriptionFascinated with the computer games, Gabriel even forgets to study. Now she needs to finish her homework, and there is an easy problem:f(n)=She is required to calculate f(n) mod 2 fo...

2018-05-03 20:34:55 161

原创 sum of power

Problem DescriptionCalculate  mod (1000000000+7) for given n,m.InputInput contains two integers n,m(1≤n≤1000,0≤m≤10).OutputOutput the answer in a single line.Sample Input10 0Sample Output10HintSourc...

2018-05-03 20:28:39 149

原创 quadratic equation

Problem DescriptionWith given integers a,b,c, you are asked to judge whether the following statement is true: "For any x, if a⋅+b⋅x+c=0, then x is an integer."InputThe first line contains only one int...

2018-05-03 20:17:57 713

原创 company(思维 + 贪心)

Problem DescriptionThere are n kinds of goods in the company, with each of them has a inventory of  and direct unit benefit . Now you find due to price changes, for any goods sold on day i, if its dir...

2018-05-03 19:47:44 2372

原创 fireworks(杨辉三角+组合数学)

Problem DescriptionHmz likes to play fireworks, especially when they are put regularly.Now he puts some fireworks in a line. This time he put a trigger on each firework. With that trigger, each firewo...

2018-05-03 18:48:08 277

原创 HEX(组合数学+逆元+思维)

Problem DescriptionOn a plain of hexagonal grid, we define a step as one move from the current grid to the lower/lower-left/lower-right grid. For example, we can move from (1,1) to (2,1), (2,2) or (3,...

2018-05-03 17:01:49 221

空空如也

空空如也

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

TA关注的人

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