Uva_10900
From the very beginning, I had a problem with my thinking. Later I checked out the problem report from other people and finally found out that I was suitable for taking risks but not gambling ......
We may wish to set a [I] to indicate
ProblemTerrain
The P in the question refers to the number of different paths covered by all the shortest paths between any two points. The maximum value of P is required.
A direct and violent idea is to use Floyd to process the shortest circuit
Uva_147
Count with DP, the state transition equation is f [I] [J] = sum {f [I] [J-K * A [I]} (J-K * A [I]> = 0, K is an integer), where I represents the I-th nominal value, j Represents the cents with J, and a [I] represents the size of the I-th
Uva_12295
First, we can fold both sides of the line into a half matrix. At the same time, the problem is converted into the number of shortest paths from the upper left corner to the line position.
First, we can use spfa to find the
Uva_11205
At the beginning, I encountered a serious problem in understanding the meaning of the question. Later I came up with someone else's report saying that the minimum number of columns in the given matrix can be selected to distinguish
Uva_193
It is not difficult to understand the meaning of this question, but because the number of nodes of this question can reach the maximum100If each vertex is enumerated in sequence and the point can be painted black, it will time out.
Uva_10051
SetCubeSplit the body into six parts, and then find the longest ascending subsequence.
# Include # Include String . H> # Define Maxd 3010 Char B [] [ 10 ] = { " Front " , " Back " , " Left " , " Right " , " Top " , " Bottom "
Uva_11133
This topic is actually a problem with multiple backpacks, but it requires that the number of solutions be recorded.
# Include # Include String . H> # Define Maxd 10010 Int N; Long Long Int F [maxd]; Void Solve (){ Int I, J,
Uva_10030
For the capacity limit of each point in the question, we can set a point I Split into two points 2 * I And 2 * I ^ 1 And a directed edge 2 * I-> 2 * I ^ 1 The capacity is the capacity limit of the point. 2 * I Inbound and
Uva_10131
First, you can sort the elephants in ascending order of weight, and then find the longest descent sub-sequence of an IQ.
# Include # Include String . H># Include # Define Maxd 1010 Int N, W [maxd], Q [maxd], F [maxd], R [maxd], p
UVA_10098
This topic is actually the enumeration arrangement on P116 in Liu lujia's White Book.
#include#include#includechar b[15];int cmp(const void *_p,const void *_q){char *p=(char *)_p;char *q=(char *)_q;return *p-*q; }void dfs(int n,char *A,
HDU_3488
It is worth mentioning that if we use the KM algorithm to find the perfect matching of minimum weights, we need to initialize the edge weight to the MAX-G [I] [j] and then find the perfect matching of the maximum right, and then convert
CF 118C
This question can be changed from Brute Force enumeration to 0 ~ 9, but the priority of a location needs to be discussed in different situations, so you can first sort the location by priority and change the number on the location in
POJ_3074
I have done this question to learn how familiar I am with Dancing Links.
#include#include#define INF 1000000000const int N = 9;const int mn = N * N * N * 4 + N * N * 4 + N;const int nn = N * N * 4 + N;int U[mn], D[mn], L[mn], R[mn], H[mn],
SPOJ_1771
This topic further trains Dancing Links to solve the problem of Queen N.
#include#include#include#define INF 1000000000const int MAXN = 50;const int MAXmn = MAXN * MAXN * 4 + MAXN * 6 + MAXN;const int MAXnn = MAXN * 6 + MAXN;int N,
UVA_10118
We can define f [n1] [n2] [n3] [n4] As when four piles receive the n1, n2, n3, and n4 candy, the maximum number of pair files that can be taken home, and an array is used to record the basket status when the status is transferred. It is
UVA_10023
I learned a hand-calculated square algorithm today, but it is not as troublesome as I thought before, because I am too lazy to knock on the Large Number Module of C ++, and I wrote it directly in Java.
import java.math.BigInteger;import
SGU_102
In the first place, gcd was used for brute force attacks. Later, I checked other people's problem-solving reports and found that I could use the Euler's function. I used it once, but now I forgot it, so I learned it again.
# Include #
UVA_10328
This is very similar to the previous topic that calculates the probability that the number of consecutive victories is k, so I moved the idea used for that question.
We set f [I] [j] to indicate the total number of consecutive H numbers
UVA_10334
This question can be guessed as a series of fibonacci columns.
If you want to prove it, let's take a look at how the light with the number of refraction n is made up, in fact, they are formed by drawing a Ray at the intersection of the
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