![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
2017CSU-ACM暑假集训
青龙指引你
也并非所有的流浪者都迷失了自我
展开
-
Flying to the Mars(Hash)
In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to find more land for the newborns . Finally , PPF decides to attack Kscinow who ruling the Mars . Here the probl原创 2017-08-07 15:54:52 · 429 阅读 · 0 评论 -
HDU 4283:You Are the One(区间DP)
The TV shows such as You Are the One has been very popular. In order to meet the need of boys who are still single, TJUT hold the show itself. The show is hold in the Small hall, so it attract a lot of boys an原创 2017-08-04 20:48:15 · 265 阅读 · 0 评论 -
POJ 2955:Brackets(区间DP)
We give the following inductive definition of a “regular brackets” sequence:the empty sequence is a regular brackets sequence,if s is a regular brackets sequence, then (s) and [s] are regular brackets sequen原创 2017-08-04 20:04:32 · 435 阅读 · 0 评论 -
CSU 1592:石子归并(区间DP)
现在有n堆石子,第i堆有ai个石子。现在要把这些石子合并成一堆,每次只能合并相邻两个,每次合并的代价是两堆石子的总石子数。求合并所有石子的最小代价。原创 2017-08-04 19:43:29 · 466 阅读 · 0 评论 -
CodeForces 527C:Glass Carving (set与multiset应用)
Leonid wants to become a glass carver (the person who creates beautiful artworks by cutting the glass). He already has a rectangular w mm × h mm sheet of glass, a diamond glass cutter and lots of enthusiasm.原创 2017-07-26 23:15:56 · 546 阅读 · 0 评论 -
CodeForces 589F:Gourmet and Banquet(二分+贪心)
A gourmet came into the banquet hall, where the cooks suggested n dishes for guests. The gourmet knows the schedule: when each of the dishes will be served.For i-th of the dishes he knows two integer moment原创 2017-07-26 22:52:00 · 326 阅读 · 0 评论 -
POJ 3111:K Best(思维+二分)
Demy has n jewels. Each of her jewels has some value vi and weight wi.Since her husband John got broke after recent financial crises, Demy has decided to sell some jewels. She has decided that she would kee原创 2017-07-26 20:34:11 · 310 阅读 · 0 评论 -
CodeForces -337A:Puzzles(水)
The end of the school year is near and Ms. Manana, the teacher, will soon have to say goodbye to a yet another class. She decided to prepare a goodbye present for her n students and give each of them a jigsaw p原创 2017-08-04 08:41:28 · 830 阅读 · 0 评论 -
UVA 11995:I Can Guess the Data Structure!(水)
Given a sequence of operations with return values, you’re going to guess the data structure. It isa stack (Last-In, First-Out), a queue (First-In, First-Out), a priority-queue (Always take out largerelement原创 2017-07-26 17:56:17 · 482 阅读 · 0 评论 -
SCU 1114:数字三角(动态规划)
下图是个数字三角,请编写一个程序计算从顶部至底部某处一条路径,使得该路径所经过的数字总和最大。原创 2017-08-03 21:00:36 · 499 阅读 · 0 评论 -
UVA 12034:Race (动态规划)
Disky and Sooma, two of the biggest mega minds of Bangladesh went to a far country. They ate, codedand wandered around, even in their holidays. They passed several months in this way. But everythinghas an e原创 2017-08-03 20:40:46 · 448 阅读 · 0 评论 -
G - River Hopscotch(二分)
Every year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, straight river with a rock at the原创 2017-07-25 22:57:20 · 328 阅读 · 0 评论 -
E - Aggressive cows(二分)
Farmer John has built a new long barn, with N (2 <= N <= 100,000) stalls. The stalls are located along a straight line at positions x1,...,xN (0 <= xi <= 1,000,000,000).His C (2 <= C <= N) cows don't like t原创 2017-07-25 22:27:22 · 472 阅读 · 0 评论 -
C - 4 Values whose Sum is 0(基础二分)
The SUM problem can be formulated as follows: given four lists A, B, C, D of integer values, compute how many quadruplet (a, b, c, d ) ∈ A x B x C x D are such that a + b + c + d = 0 . In the following, we assu原创 2017-07-25 22:11:51 · 413 阅读 · 0 评论 -
POJ 1651:Multiplication Puzzle(区间DP)
Multiplication PuzzleTime limit:1000 ms Memory limit:65536 kB Problem DescriptionThe multiplication puzzle is played with a row of cards, each containing a single positive integer. During the move pla原创 2017-08-04 20:58:55 · 393 阅读 · 0 评论 -
HDU - 2045:不容易系列之(3)—— LELE的RPG难题(递推)
人称“AC女之杀手”的超级偶像LELE最近忽然玩起了深沉,这可急坏了众多“Cole”(LELE的粉丝,即"可乐"),经过多方打探,某资深Cole终于知道了原因,原来,LELE最近研究起了著名的RPG难题:原创 2017-07-27 20:14:59 · 602 阅读 · 0 评论 -
The Suspects (并查集)
Severe acute respiratory syndrome (SARS), an atypical pneumonia of unknown aetiology, was recognized as a global threat in mid-March 2003. To minimize transmission to others, the best strategy is to separate th原创 2017-08-07 15:47:47 · 443 阅读 · 0 评论 -
Virtual Friends (并查集)
These days, you can do all sorts of things online. For example, you can use various websites to make virtual friends. For some people, growing their social network (their friends, their friends' friends, their原创 2017-08-07 15:44:13 · 756 阅读 · 0 评论 -
CSU 1224: ACM小组的古怪象棋(BFS)
ACM小组的Samsara和Staginner对中国象棋特别感兴趣,尤其对马(可能是因为这个棋子的走法比较多吧)的使用进行深入研究。今天他们又在 构思一个古怪的棋局:假如Samsara只有一个马了,而Staginner又只剩下一个将,两个棋子都在棋盘的一边,马不能出这一半棋盘的范围,另外这 一半棋盘的大小很奇特(n行m列)。Samsara想知道他的马最少需要跳几次才能吃掉Staginner的将(我们假定其不会移动)。原创 2017-07-31 20:44:25 · 398 阅读 · 0 评论 -
CodeForces 416C:Booking System(贪心)
Innovation technologies are on a victorious march around the planet. They integrate into all spheres of human activity!A restaurant called "Dijkstra's Place" has started thinking about optimizing the bookin原创 2017-08-06 15:44:34 · 379 阅读 · 0 评论 -
CSU 1960:单源最大权路径 (DFS)
有一棵由N个结点构成的树,每一条边上都有其对应的权值。现在给定起点,求从该点出发的一条路径(至少有一条边)使得这条路径上的权值之和最大,并输出这个最大值。原创 2017-07-28 16:48:47 · 400 阅读 · 0 评论 -
CodeForces 607B:Zuma(区间DP)
Genos recently installed the game Zuma on his phone. In Zuma there exists a line of n gemstones, the i-th of which has color ci. The goal of the game is to destroy all the gemstones in the line as quickly as po原创 2017-08-06 11:30:38 · 542 阅读 · 0 评论 -
CodeForces 455A:Boredom (动态规划)
Alex doesn't like boredom. That's why whenever he gets bored, he comes up with games. One long winter evening he came up with a game and decided to play it.原创 2017-08-03 16:48:23 · 889 阅读 · 0 评论 -
CodeForces 734D:Anton and Chess(模拟?)
Anton likes to play chess. Also, he likes to do programming. That is why he decided to write the program that plays chess. However, he finds the game on 8 to 8 board to too simple, he uses an infinite one inste原创 2017-08-02 17:46:34 · 342 阅读 · 0 评论 -
HihoCoder - 1049:后序遍历(递归)
后序遍历 Time limit:10000 ms Memory limit:262144 kB OS:Linux Problem Description在参与过了美食节之后,小Hi和小Ho在别的地方又玩耍了一阵子,在这个过程中,小Ho得到了一个非常有意思的玩具——一棵由小球和木棍连接起来的二叉树!小Ho对这棵二叉树爱不释手,于是给它的每一个节点都标记了一个标号——一个属于A..Z的大写字母,并且没原创 2017-07-28 16:40:50 · 324 阅读 · 0 评论 -
HDU - 2553:N皇后问题(经典DFS)
在N*N的方格棋盘放置了N个皇后,使得它们不相互攻击(即任意2个皇后不允许处在同一排,同一列,也不允许处在与棋盘边框成45角的斜线上。 你的任务是,对于给定的N,求出有多少种合法的放置方法。原创 2017-07-28 16:35:53 · 601 阅读 · 0 评论 -
UVA 1608:Non-boring sequences(递归+分治思想)
We were afraid of making this problem statement too boring, so we decided to keep it short. A sequence is called non-boring if its every connected subsequence contains a unique element, i.e. an element such原创 2017-07-28 08:26:38 · 1044 阅读 · 0 评论 -
POJ 1328:Radar Installation(贪心)
Radar InstallationTime limit:1000 ms Memory limit:10000 kB OS:Linux Problem DescriptionAssume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small i原创 2017-08-01 20:39:36 · 321 阅读 · 0 评论 -
UVA 12627:Erratic Expansion(递归)
As you can see, a red balloon in the cell (i, j) (that is i-th row and j-th column) will multiply toproduce 3 red balloons in the cells (i ∗ 2 − 1, j ∗ 2 − 1), (i ∗ 2 − 1, j ∗ 2), (i ∗ 2, j ∗ 2 − 1) and a blu原创 2017-07-27 20:50:20 · 343 阅读 · 0 评论 -
D - Monthly Expense (二分)
Farmer John is an astounding accounting wizard and has realized he might run out of money to run the farm. He has already calculated and recorded the exact amount of money (1 ≤ moneyi ≤ 10,000) that he will nee原创 2017-07-25 21:01:04 · 344 阅读 · 0 评论 -
B - Can you solve this equation?(简单二分)
Now,given the equation 8*x^4 + 7*x^3 + 2*x^2 + 3*x + 6 == Y,can you find its solution between 0 and 100; Now please try your lucky.原创 2017-07-25 17:39:24 · 497 阅读 · 0 评论 -
POJ 1915:Knight Moves(BFS)
Background Mr Somurolov, fabulous chess-gamer indeed, asserts that no one else but him can move knights from one position to another so fast. Can you beat him? The Problem Your task is to write a program原创 2017-07-31 17:48:18 · 969 阅读 · 0 评论 -
CSU 1726:你经历过绝望吗?两次! (BFS+优先队列)
4月16日,日本熊本地区强震后,受灾严重的阿苏市一养猪场倒塌,幸运的是,猪圈里很多头猪依然坚强存活。当地15名消防员耗时一天解救围困的“猪坚强”。不过与在废墟中靠吃木炭饮雨水存活36天的中国汶川“猪坚强”相比,熊本的猪可没那么幸运,因它们最终还是没能逃过被送往屠宰场的命运。原创 2017-08-01 08:32:13 · 719 阅读 · 0 评论 -
CodeForces 616C:The Labyrinth(BFS)
You are given a rectangular field of n × m cells. Each cell is either empty or impassable (contains an obstacle). Empty cells are marked with '.', impassable cells are marked with '*'. Let's call two empty cell原创 2017-07-31 20:46:03 · 634 阅读 · 0 评论 -
HDU 1242:Rescue(BFS+优先队列)
Angel was caught by the MOLIGPY! He was put in prison by Moligpy. The prison is described as a N * M (N, M <= 200) matrix. There are WALLs, ROADs, and GUARDs in the prison.原创 2017-07-31 20:38:57 · 335 阅读 · 0 评论 -
HDU 1241:Oil Deposits(BFS)
The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land int原创 2017-07-31 20:14:39 · 236 阅读 · 0 评论 -
Equations(Hash)
Consider equations having the following form: a*x1^2+b*x2^2+c*x3^2+d*x4^2=0 a, b, c, d are integers from the interval [-50,50] and any of them cannot be 0. It is consider a solution a system ( x1,x2,x原创 2017-08-07 16:00:31 · 559 阅读 · 0 评论 -
HDU 1312:Red and Black(BFS)
There is a rectangular room, covered with square tiles. Each tile is colored either red or black. A man is standing on a black tile. From a tile, he can move to one of four adjacent tiles. But he can't move on原创 2017-07-31 17:41:15 · 393 阅读 · 0 评论 -
B - UmBasketella (三分)
Twenty-four pointTime limit:1000 ms Memory limit:65536 kB OS:Linux Problem DescriptionIn recent days, people always design new things with multifunction. For instance, you can not only use cell phone原创 2017-07-30 20:40:24 · 289 阅读 · 0 评论 -
CSU - 1600:Twenty-four point(DFS)
Given four numbers, can you get twenty-four through the addition, subtraction, multiplication, and division? Each number can be used only once.原创 2017-07-28 20:38:36 · 290 阅读 · 0 评论