Hut-2602 01 backpack record path

# Include # Include # Include Using Namespace STD; Int P [ 1005 ], W [ 1005 ], DP [ 1005 ] [ 1005 ], N, V; Void DP () {memset (DP, 0 ,Sizeof (DP )); For ( Int I = 1 ; I I ){ For ( Int J = V; j> = 0 ;-- J ){ If (J> = W [I] & DP [I- 1 ]

Simulation of POJ-2632 crashing robots

This is a pure simulated question. You only need to simulate it carefully. At the beginning, you changed the row-column relationship according to your own ideas, and the results were in disorder. After this certificate, the AC. CodeAs follows: #

HDU-4255 a famous grid BFS

It is a snake matrix, then the prime number is filtered out to mark the final BFs. Pay attention to the number path between 1-, but it does not mean that we only need to print the prime number in this range, because it is very likely that the edge

HDU-1181 rank of Tetris (override) topological sorting + query set

I did not pay attention to this topic. As a result, the error was found many times and I still did not find the error. The cause is that the ancestor node is directly searched for when the first round of finding the node with zero inbound level.

HDU-1505 City game dynamic planning

Http://acm.hdu.edu.cn/showproblem.php? PID = 1, 1505 Self-written diaosi code: #include #include #include #define MAXN 1050using namespace std;int N, M, u[MAXN][MAXN], l[MAXN][MAXN], G[MAXN][MAXN];inline int max(int x, int y){ return x > y ? x :

Dynamic Planning for HDU-1069 monkey and banana

Simple Dynamic Planning: divides cubes into six, and then sorts them in double order. Then, DP is enough. For the current square, select the maximum value of the square that can be placed in front and the height of the square. The Code is as follows:

HDU-2602 Bone Collector 01 backpack

01 backpack bare template questions # Include # include # include # define maxn 1005 using namespace STD; int N, V, p [maxn], V [maxn], DP [maxn]; inline int max (int x, int y) {return x> Y? X: Y;} void zobag (int x) {for (INT I = V; I> = V [X];

Hut-1697 board coverage

Given a chessboard, some vertices are deleted and asked how many 1*2 dominoes can be placed in it at most in this case. This problem can be solved by Bipartite Graph Matching. By copying a two-dimensional graph, two adjacent points of Domino can be

How many ways dynamic planning HDU-1978

I won't say much about the meaning of the question. At the beginning, I was still using search to write the question. I set two directions, marked with de-duplication, various types, and then it's TLE. The positive solution is the number of holding

HDU-2955 robberies DP

The question is the question of probability. It means to rob Bank A. the probability of being caught is Ai. The probability of being captured is bi, therefore, the probability of not being caught is (1-ai) * (1-bi )...... therefore, we use the

POJ-2996 help me with the game simulation

This is a purely simulated question and does not require any algorithms. Define the sorting rules when selecting a piece and sort it out at a time. The Code is as follows: # Include # include # include # include # include using namespace STD;

HDU-1569 square number (2) min cut max flow

The meaning of the question is very simple. Remember to use State compression when getting the number (1) of squares. Here, the number of rows and columns is too large to be compressed. Therefore, we need to use the thought of minimizing the largest

POJ-3349 snowflake snow snowflakes hash

This question is directly two for loops, so here we need to hash and then sort them once, so that we only need to compare the two adjacent strings with the same hash value. The Code is as follows: # Include # include # include # include # define

POJ-1789 truck history minimal spanning tree

    Calculates the minimum number of characters that need to be changed throughout the automobile evolution. The calculated number of characters is 1-7 characters.   The Code is as follows:   #include #include #include #include using namespace

Simulation of POJ-1068 parencodings

This is a simulated question that may be difficult to understand. The first sequence means: A [I] indicates the number of left brackets on the left of the I-th right brace. B [I] indicates the number of left parentheses between the right brace I and

POJ-1258 agri-net minimal spanning tree

The most direct minimal spanning tree. The Code is as follows: #include #include #include #include using namespace std;int N, pos, set[105];struct Node{ int x, y, dist; bool operator

The problem of Zhou zhenghu in HUT-XXXX

This question can be directly divided into two parts. Pay attention to the return value of the second part. It is best to manually simulate it in the future. The Code is as follows: # Include # include # include # include using namespace STD;

POJ-1753 flip game Gauss

We can refer to the switch question, but here is the minimum number of operations, so we need to enumerate the variable to calculate the minimum number of changes in all cases. The Code is as follows: # Include # include # include # include #

Continuous Factorization of HUT-XXXX digital games

This question can be used even in Java, because it is the simplest. Of course, the writing of the two for loops is also very simple. Here we will directly write the method of prime factor decomposition. For the number in a, we can decompose each

POJ-1681 painter's problem high elimination

The Code is as follows: # Include # include # include # include # define to (x, y) (x-1) * n + yusing namespace STD; char G [30] [30]; int dir [4] [2] = {1, 0,-1, 0, 0, 1, 0,-1}, N; int C; inline bool judge (int x, int y) {If (x N | Y N)

Total Pages: 64722 1 .... 55853 55854 55855 55856 55857 .... 64722 Go to: GO

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.