I heard often send explanations rp ++
Portal password: 12345ssdlh This password is required to remember the magic of music with wxg
T1
Contest2178 - 2019-4-18 noip a high point of the basics of testing 7 T3
Please do not read their own blog before
T2
Shock! Los questions on this topic Purple Valley!
But it is still very simple
First of all, according to results sort
Then, each cow may be enumerated median, according to the characteristics of the median from each constant n / 2 cows around it
Suppose median set at i, l [i] represents a 1-i front n / 2 and the number, r [i] represents a front ic n / 2 number and
Then only need to meet i.money + l [i-1] + r [i + 1] <= F
Consider how quickly obtain l and r
Suppose we known l [i-1], for i.money, we need only compare i.money and has taken the biggest, small who who will
It is clear that with a heap can be maintained
Code
T3
Shocked, Blue Valley on this topic Los question!
But just a dfs solved
I will not tell you because I WA50 is a small array of open
According to the meaning of problems can be simulated dfs
Only need to add a memory, that is the ability to have the same value at the same time, then surely the same number can be slippery
Memories of what it is
Enough
Some of the remaining gods pruning use as appropriate
Code
T4
Set DP [i] [j] denotes the number of years before taking some of the number i, and let them% m = number of program j
Then, dp [i] [j] = dp [i-1] [j] + dp [i-1] [(ja [i])% m], a [i] denotes the i-th
Code
T5
Set dp [l] [r] represents the gold left lr this time interval, the maximum benefit that person can be taken now to take
Well, apparently taken after completion of a need to make the next income individuals to obtain the minimum
所以,dp[l][r]=s(l,r)-min(dp[l][r-1],dp[l+1][r])
Code
T6
Shock! This question is blue title in Los Valley!
In fact, this is a question of the easiest
To meet the sub-tree, if it is less, then find the smallest point weights in the sub-tree, which was added just fine
Code
T7
First-half the ratio k
For edges (u, v), it will be seen right side e [i] .len * k-pos [v]
Then forfeit ring just fine
The most basic method is negative ring spfa
That is, if a point enqueue than m times, then there must be a negative ring
Code