HDU 5358Test instructionsBeg ∑ i = 1 n ? ∑? J=i ? N ??(?Lo g? 2 ??S(I,J)?+1)?(I+J). Ideas:S (i,j) Mainly write it is more difficult to some, some details more tangled, a certain way of thinking to clarify and then write.PS. This card constant is not human, you must remember to preprocess the interval mapping, otherwise n (logn) ^2 also have to kneel.Code/** @author novicer* language:c++/c*/#include
Copyright notice: Bo Master said authorized all reproduc
ID Origin Title
96/114
Problem A
Uvalive 4167
Parity
60/124
Problem B
Uvalive 4168
Lampyridae Teleportae
3/11
Problem C
Uvalive 4169
Hex Tile equations
17/41
Problem D
Uvalive 4170
The Bridges of San Mochti
16/36
Problem E
Uvalive 4171
Bulletin Board
2/21
Problem F
Uvalive 4172
ID
Origin
Title
96/114
Problem A
Uvalive 4167
Parity
Water Question 1
60/124
Problem B
Uvalive 4168
Lampyridae Teleportae
Water Question 3
3/11
Problem C
Uvalive 4169
Hex Tile equations
17/41
Problem D
Uvalive 4170
The Bridges of San Mochti
16/36
Problem E
Uvalive 4171
Bulletin Board
2/21
person AC, decisively gave up the problem of E, began to do a problem, 10 minutes to finish the code, ce!! The original missing string header file, and then submit! Array out-of-bounds: Submit again! WA, only to find the sample data is a pit, own two sets of data, WA 3 times, found "= =" written "=", the data is very easy to, or wa! At that time, the game began two hours, a question submitted 7 times, or a place, o written 0, because of the reasons for Codeblock, can not see it. It's time to St
and check the set. Add the edge from the back.#include #includestring.h>#include#includeusing namespacestd;Const intMAXN =1000000+Ten;intFATHER[MAXN], U[MAXN], V[MAXN], Q, Q[MAXN], ANS[MAXN], FF[MAXN];intFindintx) { if(x = father[x]) father[x] =find (father[x]); returnfather[x];}intMain () {intN, M, I; while(~SCANF ("%d%d", n, m) {memset (FF,0,sizeof(FF)); for(i =0; I i; for(i =1; I "%d%d", u[i], V[i]); scanf ("%d", p); for(i =1; I "%d", q[i]); Ff[q[i]] =1; } inttot = n;//there are n sets
Problem-solving ideas: And check the water problems, many years ago with violent water.Problem Solving Code:1 //File name:c.c2 //Author:darkdream3 //Created time:2013 March 01 Friday 00:37 28 seconds4 5#include 6#include string.h>7#include 8#include 9#include Ten One BOOLa[102][102] = {0}; A intf[102]; - intb[102] = {0}; - intMain () { the - //freopen ("Input.txt", "R", stdin); - //freopen ("Output.txt", "w", stdout); - intN, m, p =0; +scanf"%d%d",n,m); - for(inti =1; I ) + { A
][j]); the printf ("******\n"); - }*/ $ while(!qu.empty ()) the { theQunode tmp =Qu.front (); the //printf ("%d\n", tmp.num); the Qu.pop (); -Mians = min (mians,yd-p[tmp.num].y); in the if(Tmp.num = = n+1) the { AboutOK =1; the returnTmp.step; the } the for(inti =0; i ) + { - if(!Vis[mp[tmp.num][i]]) the {Bayi //printf ("%d to%d\n", Tmp.num,mp[tmp.num][i]); theVis[mp[tmp.num][i]] =1; t
maintenance less, the wording is a lot more concise, I think if this idea, perhaps half an hour is enough to cross the problem, but the scene of my only endless DebugPrint the4page code. The time is soon to last one hours,Wddsaid he had crashed,BThe problem is not estimated.wkThere is no movement, I have a hint of foreboding. After the data has finally been sent, returnWA, the fault of the shady,wkthe last half hour was shot.J, but also wrong, regret the end. Later learnedMathloverand so many D
Simple topological ordering, output in dictionary order.#include #include#include#include#include#includeusing namespacestd;intn,m,u,v;Const intmaxn=1111;//set Number of nodesintINDEGREE[MAXN];//in degreesintPRI[MAXN];//OutputintTot//OutputintStart,end;//start and end of vertex numberingvectorint>G[MAXN];structcmp1{BOOL operator()(inta,intb) {returna>b;//Minimum value First}};p riority_queueint,vectorint>,cmp1>Q;voidToposort () {inti; for(I=start; i) if(!Indegree[i]) Q.push (i); whil
To ensure that we can reach the finish line, we need to meet the following two conditions1. Able to reach all summits2. Able to meet bitter potatoes faster than hisThe speed of the two can be done by the law of Conservation of energy, and the coordinates of the bitter potatoes can be made by triangular similarity.#include #include#include#include#include#include#includeusing namespacestd;#defineMOD 1000000007Const intinf=0x3f3f3f3f;Const Doubleeps=1e-5; typedefLong Longll;#defineCL (a) memset (A
http://acm.hdu.edu.cn/showproblem.php?pid=1285determine the position of the matchTime limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others)Total submission (s): 18484 Accepted Submission (s): 7399problem DescriptionThere are N teams (1Inputthe input has several groups, the first behavior in each group is two number n (1Outputgive a ranking that meets the requirements. There is a space between the queue numbers at the time of the output, and no space after the last. Other Note
Test instructions: Give you some boards up to 2 wide and let you put them in a box with a width of two and ask you how long the box is.Problem solving: DP, the nearest value from the middle.Problem Solving Code:1 //File name:a.cpp2 //Author:darkdream3 //Created time:2015 March 28 Saturday 12:13 56 seconds4 5#include 6#include 7#include 8#include Set>9#include Ten#include One#include A#include -#include -#include the#include -#include -#include -#include +#include -#include +#include
Enter the number of players N and the numbers of people you want to win, M,then enter the n * N of the winning and losing table, line I j column 1, representing I can win J.How many possibilities are there for M to win at the end and the minimum height of the total race tree?like Input:
7 2
0 1 0 0 0 1 0
0 0 1 0 1 1 1
1 0 0 1 1 0 0
1 1 0 0 0 1 0
1 0 0 1 0 0 1
0 0 1 0 1 0 0
1 0 1 1 0 1 0
The output:
139
#include Ideas:Dp[root][height][set] r
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.