- 博客(101)
- 资源 (21)
- 收藏
- 关注
原创 HDU-5077-NAND(DFS+打表)
Problem DescriptionXiaoqiang entered the “shortest code” challenge organized by some self-claimed astrologists. He was given a boolean function taking n inputs (in C++):bool f(bool x1, bool x2,
2014-10-25 16:58:50
1783
原创 HDU-4249-A Famous Equation(DP)
Problem DescriptionMr. B writes an addition equation such as 123+321=444 on the blackboard after class. Mr. G removes some of the digits and makes it look like “1?3+??1=44?”. Here “?” denotes remo
2014-10-22 01:01:23
1394
原创 HDU-4782-Beautiful Soup(模拟)
Problem Description Coach Pang has a lot of hobbies. One of them is playing with “tag soup” with the help of Beautiful Soup. Coach Pang is satisfied with Beautiful Soup in every respect, except t
2014-10-06 21:59:05
2149
原创 UVALive-6485-Electric Car Rally(BFS)
题目:点击打开链接思路:对于当前位置的每一个时间段都要走一遍(除了那些需要的时间比最大允许的时间还大的),用 整形 vis[当前位置][剩余油量] 标记。#include #include #include #define INF 999999999using namespace std;struct S{int pos,time,remain;bool
2014-10-06 10:45:07
1245
原创 HDU-2857-Mirror and Light(计算几何)
Problem DescriptionThe light travels in a straight line and always goes in the minimal path between two points, are the basic laws of optics.Now, our problem is that, if a branch of light goes
2014-10-03 02:00:20
1211
原创 HDU-2844-Coins(多重背包)
Problem DescriptionWhuacmers use coins.They have coins of value A1,A2,A3...An Silverland dollar. One day Hibix opened purse and found there were some coins. He decided to buy a very nice watch in
2014-10-03 00:06:33
1105
原创 HDU-1053-Entropy(Huffman编码)
Problem DescriptionAn entropy encoder is a data encoding method that achieves lossless data compression by encoding a message with “wasted” or “extra” information removed. In other words, entropy
2014-10-02 22:52:26
1033
原创 HDU-4407-Sum(容斥原理)
Problem DescriptionXXX is puzzled with the question below: 1, 2, 3, ..., n (1Operation 1: among the x-th number to the y-th number (inclusive), get the sum of the numbers which are co-prim
2014-09-30 00:34:04
1287
原创 UVALive-6665-Dragons Cruller(BFS+Hash)
题目在此思路:很经典的搜索。时间比较紧,用map会T。hash函数用了 康托展开。#include #include #define INF 99999999using namespace std;struct S{int pos,mp[9],step;bool operator<(const S &p) const{ return step>p.s
2014-09-26 22:19:03
1079
原创 HDU-4419-Colourful Rectangle(线段树)
Problem DescriptionWe use Red, Green and Blue to make new colours. See the picture below:Now give you n rectangles, the colour of them is red or green or blue. You have calculate the area
2014-09-25 08:05:11
1104
原创 HDU-5040-Instrusive(BFS+优先队列)
Problem DescriptionThe legendary mercenary Solid Matt gets a classic mission: infiltrate a military base.The military base can be seen as an N * N grid. Matt's target is in one of the grids an
2014-09-21 17:49:09
2165
原创 HDU-5031-Lines(DFS)
Problem DescriptionYou play a game with your friend. He draws several lines on the paper with n×m square grids (see the left figure). After that, he writes down the number of lines passing through
2014-09-20 23:47:34
2297
2
原创 HDU-5025-Saving Tang Monk(BFS+优先队列)
Problem Description《Journey to the West》(also 《Monkey》) is one of the Four Great Classical Novels of Chinese literature. It was written by Wu Cheng'en during the Ming Dynasty. In this novel, Monke
2014-09-20 18:48:10
1850
原创 UVALive-6656-Watching the Kangaroo(二分)
Day by day number of Kangaroos is decreasing just liketiger, whale or lions. So I decided to make them a sanctuarywhere they will live peacefully. I do not let visitors gonear them. So I planted
2014-09-19 02:25:15
1909
原创 HDU-4031-Attack(树状数组)
Problem DescriptionToday is the 10th Annual of “September 11 attacks”, the Al Qaeda is about to attack American again. However, American is protected by a high wall this time, which can be treatin
2014-09-17 23:31:00
1078
原创 HDU-5014-Number Sequence
Problem DescriptionThere is a special number sequence which has n+1 integers. For each number in sequence, we have two rules:● ai ∈ [0,n] ● ai ≠ aj( i ≠ j )For sequence a and sequence b,
2014-09-15 00:27:02
1906
2
原创 UVA-10603-Fill(BFS+优先队列)
There are three jugs with a volume of a, b and c liters. (a, b, and c are positive integers not greater than 200). The first and the second jug are initially empty, while the thirdis completely fill
2014-09-02 22:25:50
1382
原创 HDU-2259-Continuous Same Game (2)(BFS+DFS+模拟)
Problem DescriptionAfter repeated attempts, LL finds the greedy strategy is very awful in practice. Even there is no apparent evidence to proof it is better than a random one. So he has to drop th
2014-09-02 10:48:26
1311
原创 HDU-3681-Prison Break(BFS+状压DP+二分)
Problem DescriptionRompire is a robot kingdom and a lot of robots live there peacefully. But one day, the king of Rompire was captured by human beings. His thinking circuit was changed by human an
2014-08-28 10:55:06
1520
原创 HDU-3085-Nightmare Ⅱ(双向BFS)
Problem DescriptionLast night, little erriyue had a horrible nightmare. He dreamed that he and his girl friend were trapped in a big maze separately. More terribly, there are two ghosts in the maz
2014-08-27 21:19:10
1864
原创 HDU-3533-Escape(BFS)
Problem DescriptionThe students of the HEU are maneuvering for their military training.The red army and the blue army are at war today. The blue army finds that Little A is the spy of the red ar
2014-08-27 17:01:13
1299
原创 UESTC-888-Absurdistan Roads(kruskal+floyd)
The people of Absurdistan discovered how to build roads only last year. After the discovery, every city decided to build their own road connecting their city with another city. Each newly built road c
2014-08-27 10:35:01
1270
原创 CF-85D-Sum of Medians(线段树)
In one well-known algorithm of finding the k-th order statistics we should divide all elements into groups of five consecutive elements and find the median of each five. A median is called the middl
2014-08-25 22:38:56
1229
原创 HDU-4288-Coder(线段树)
Problem Description In mathematics and computer science, an algorithm describes a set of procedures or instructions that define a procedure. The term has become increasing popular since the adven
2014-08-25 22:02:02
1432
原创 HDU-4973-A simple simulation problem.(线段树)
Problem DescriptionThere are n types of cells in the lab, numbered from 1 to n. These cells are put in a queue, the i-th cell belongs to type i. Each time I can use mitogen to double the cells in
2014-08-25 00:41:31
976
原创 HDU-4947-GCD Array(树状数组+莫比乌斯反演)
Problem DescriptionTeacher Mai finds that many problems about arithmetic function can be reduced to the following problem:Maintain an array a with index from 1 to l. There are two kinds of ope
2014-08-18 15:21:42
2043
1
原创 HDU-1695-GCD(莫比乌斯反演)
Problem DescriptionGiven 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may
2014-08-15 14:49:13
1141
原创 HDU-2258-Continuous Same Game (1)(DFS+模拟)
Problem DescriptionContinuous Same Game is a simple game played on a grid of colored blocks. Groups of two or more connected (orthogonally, not diagonally) blocks that are the same color may be remo
2014-08-13 21:15:01
904
原创 HDU-3295-An interesting mobile game(BFS+DFS)
Problem DescriptionXQ,one of the three Sailormoon girls,is usually playing mobile games on the class.Her favorite mobile game is called “The Princess In The Wall”.Now she give you a problem about th
2014-08-13 16:36:18
1754
原创 HDU-1195-Open the Lock(BFS)
Problem DescriptionNow an emergent task for you is to open a password lock. The password is consisted of four digits. Each digit is numbered from 1 to 9.Each time, you can add or minus 1 to any
2014-08-13 14:24:29
681
原创 HDU-2102-A计划(BFS+优先队列)
Problem Description可怜的公主在一次次被魔王掳走一次次被骑士们救回来之后,而今,不幸的她再一次面临生命的考验。魔王已经发出消息说将在T时刻吃掉公主,因为他听信谣言说吃公主的肉也能长生不老。年迈的国王正是心急如焚,告招天下勇士来拯救公主。不过公主早已习以为常,她深信智勇的骑士LJ肯定能将她救出。现据密探所报,公主被关在一个两层的迷宫里,迷宫的入口是S(0,0,0),公主的位
2014-08-13 10:51:11
613
原创 HDU-2437-Jerboas(BFS+优先队列)
Problem Description Jerboas are small desert-living animals, which resemble mice with a long tufted tail and very long hind legs. Jerboas shelter in well-hidden burrows. They create two types o
2014-08-13 09:43:44
1291
原创 HDU-1067-Gap(BFS+HASH)
Problem DescriptionLet's play a card game called Gap. You have 28 cards labeled with two-digit numbers. The first digit (from 1 to 4) represents the suit of the card, and the second digit (from 1
2014-08-12 09:42:09
1229
原创 HDU-3309-Roll The Cube(BFS)
Problem DescriptionThis is a simple game.The goal of the game is to roll two balls to two holes each.'B' -- ball'H' -- hole'.' -- land'*' -- wallRemember when a ball rolls into a hole, the
2014-08-11 20:52:22
829
原创 HDU-1685-Booksort(IDA*)
Problem DescriptionThe Leiden University Library has millions of books. When a student wants to borrow a certain book, he usually submits an online loan form. If the book is available, then the next
2014-08-11 14:18:07
1427
原创 HDU-4924-Football Manager(DFS+DP)
Problem DescriptionFootball Manager is a series of football management simulation games developed by Sports Interactive and published by Sega. In this game, you will play a role of a football club m
2014-08-10 21:51:59
1206
原创 HDU-3839-Ancient Messages(DFS)
Problem DescriptionIn order to understand early civilizations, archaeologists often study texts written in ancient languages. One such language, used in Egypt more than 3000 years ago, is based on c
2014-08-04 10:01:03
1482
原创 HDU-2821-Pusher(DFS)
Problem DescriptionPusherBoy is an online game http://www.hacker.org/push . There is an R * C grid, and there are piles of blocks on some positions. The goal is to clear the blocks by pushing into t
2014-08-02 23:00:57
1231
原创 HDU-2128-Tempter of the Bone II(BFS)
Problem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze was changed and the way he came in was lost.He realized that the bo
2014-08-02 21:31:42
1088
原创 HDU-3502-Huson's Adventure Island(BFS+状压DP)
Problem DescriptionA few days ago, Tom was tired of all the PC-games, so he went back to some old FC-games. "Hudson's Adventure Island" was his favorite which he had played thousands of times. But t
2014-08-01 10:15:46
930
英语视听说 辅助
2014-02-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人