"Miscellany" THUWC 2020 Travels

\(Day?\)

Registration time spans almost a week and more, here there upload a print one, kinda trouble ...... application or through the last, it seems \ (CSP \) managed to get not too fried ......

\ (Dy0 \)

Then fly to Beijing to go. There go the same level of \ (Tiw \) giant guy, sophomore \ (MasterYi \) and \ (Darkness \) chiefs, as well as two junior school brother, big brother is. Ah, all I can to the floor by friction (stronger \ (Freopen \) even as early've got the top prize did not go to \ (orz \) ), and sure enough my dishes.

The morning before the afternoon aircraft, because someone has to go \ (PKU \) , so stay hotels are not the same, \ (PKU \) and \ (THU \) be said to be very close, but we walk or go for a while (originally the same as riding a bike on the imagination, but said the weather is too cold, it will freeze the hand). The weather was cold, but the indoor heating are everywhere, but do not feel anything. He and \ (PKU \) students separately, admitted from \ (THU \) relatively close to the hotel.

Test machine the next day, so the evening did not go to \ (THU \) , nor to stroll the streets, and on the review template generation polynomial function in the room(However, the final findings do not spend). And finally hit the post template out of a half-plane, the template on the Los pay out of the valley over, nothing to do, then rest.

\(Day1\)

Morning to report for duty, somatosensory take a long time. \ (THUWC2020 \) on a badge or \ (2019 \) years (fog). Made a scarf, very good, did not open a letter is the last ......

Mo was an informal athletes computer, can only use their own laptop. Now with their own, there is no need to test machine it ......
then test machine ( \ (\ Times \) ), simulated game ( \ (\ sqrt {} \) )
zeroth title, \ (A + B \ problem \) , probably used to test the site, do not know why my laptop to board \ (THU \) site very slow, always to be loaded for a long time ......
and then see a first question, sort and indiscriminately prefix + probably \ (40min \) get.
The second question, the tree has no more than the number of color blocks \ (2 \) species, which is the tree \ (the DP \) . \ (O (n ^ 2) \) very good demand, but the space-time will be \ (GG \) , first stood.
The third question, string, slip of the slip.

Want to optimize the second question, I thought out. Finally did not pay (after all, just test machine).

Very good subject, is said to be \ (THUWC2018 \) the original title. Difficulty probably increase, and it \ (Tiw \) chiefs to discuss the second question for a moment, about the value segment tree merger maintenance probably on the line, test a little brain, more details.

Noon forced back to the room to rest, cushions off the opening ceremony and group photo (conventional operation, which I feel I do not have time to participate in the photo).

Informal player game start time is later \ (35min \) , I do not know why. \ (THU \) began in the engine room of the network can only provide boarded submit your site, so he had to rest lying on the table and other games.

Unconsciously \ (35min \) passed, and start the race, to see the title.

first question

Questions surface: \ (k \) personal, everyone has an initial wage \ (a_i \) , \ (the n-\) operations, given \ (p \) and \ (B_1, B_2 \ cdots b_k \) , if \ (b_p> a_p \) , put \ (A \) into \ (B \) , \ (Q \) times asked each time a given initial salary (that is, \ (A \) ), the final demand pay.
Data range: \ (. 1 \ n-Leq, Q \ ^ Leq 10 5,1 \ Leq K \ Leq 20 is \)

I feel very simple, easy way to detect changes after the initial wage for the first time be replaced has been fixed, then we can enumerate the first time be replaced which people pay up. First monotonous stack to replace each lost inside an array, then half of the answer can know this man a raise at what time, everyone can find for the first time takes a minimum value changes over time. Then the output at this time as a starting point the answer just fine.

Processing at certain time of the answer can be as a starting point, the way may be determined when the stack monotone complexity \ (O (K (n-Q +) \ n-log) \) , theoretically too. From start to finish it took about thought \ (1h20min \) , pay up \ (Pretest \) too, no control, and to see the \ (T2 \) .

The second question

Questions surface: a directed graph, \ (q \) once asked a given point \ (x \) and the number of steps \ (S \) , each selection \ (x \) is a minimum number while walking, go ask \ (s \) after the second stop where (if there is nowhere to go when the number of steps will stop). The first \ (i \) edges go \ (w_i \) after deleting times, after asking the number of edges traversed will leave when asked.
Data range: \ (n-, Q \ ^ Leq 10. 5, m \ Leq for 1.5 * 10 ^. 5, S \ ^ Leq. 9 W 10 \ 18 is Leq 10 ^ {} \) .

The problem first glance feel sick ah \ (QAQ \) . Consider an arbitrary time point, formed by the edges to go something certainly forest ring (which may have a common tree). Because of the degree of up to \ (1 \) , then each is actually asked to come to the ring (the road if you take off one side was immediately disconnected and then received another point), then circling the ring, until finish ring opening or the number of steps. Ring off then have to draw a line on. How you can see \ (LCT \) optimization, just disgusting ah \ (orz \) ......

So think of cheat points, first \ (O (\ sum s) \) violence hop side, a number of small data / random data can be ran. Then \ (W_i \) is much larger than \ (S \) , the edge does not disconnect, then multiplication will complete a thing.
Such a combined \ (41 \) points.

Where there are trees and tree-based ring, it looks like to do.
First consider the tree, each distance from a start point of a period to climb, or reach to the root requires either a disconnection point (if there can climb from \ (0 \) edge determination). Then all sides to this paragraph \ (--1 \) , it seems gone. Eh eh, chain tree, then are we going to cross + segment tree? Then find the first no (0 \) \ -side location, would not be half? Such calculated ...... \ (O (the n-\ log ^ the n-3) \) how do ......

Just for a moment ...... finally decided to play this algorithm, the result \ (O (n \ log ^ 3 n) \) really exploded ......

So roll up to see the third question ......

The third question

Title surfaces: the right side of a tree units, given a constant \ (X-\) , \ (m \) times asked Q \ ([l, r] \ ) is the number of points Unicom blocks, connected to two points defined a distance of no more than \ (the X-\) .
Data range: \ (n-\ Leq. 3. 5 * 10 ^, m \ Leq. 6. 5 * 10 ^ \)

God, no, autistic ......

Slowly sub-part look at what you can take, \ (4 \) points violence, \ (4 \) points output \ (1 \) , other \ (GG \) .

The examination room

\ (Day1 \) is probably \ (100 + 41 + 8 = 149 \) , and I'm so weak ah ...... \ (Tiw \) chiefs discussed a moment, it looks like a small tree second question, the other probably Volkswagen points.

Evening knocked a network flow template to rest.

\ (Day2 \)

Tsinghua come up in the morning on foot, walking for about \ (15 \) minutes now, probably a kilometer away?
I do not know why the extra morning game delayed by \ (20min \) , after the game to be \ (2 \) points.

first question

Questions surface: \ (the n-\) reports \ ((ai, BI, CI) \) , the initial excitement value \ (S \) , excited to listen to a report value becomes \ (a_i * | s | + b_i * s + C_i \) , reorder report, seeking the most excitement value.
Data range: the absolute value of all input values \ (\ Leq 15 \) (containing \ (n-\) ), the answer may be __int128stored.

To see how this is like pressing \ (DP \) ah ...... seems to be \ (the n-3 ^ \) ? But \ (15 \) run \ (3 ^ n \) very slow it. And do not see there is any need \ (3 ^ n \) where ......
consider for a moment, I found that each value is excited linear function segments, with the typical monotony. So, certainly the biggest result: maximum positive number, the smallest positive number, the largest negative number, the smallest negative number of generations go answer it. However, the problem may be a bit large, not just the maximum result we have to calculate, because the way to use positive and negative, respectively, the maximum and minimum values, and a minimum reason of the provisions of the symbol, is equivalent to the closer \ (0 \) more well, not monotonous.

This time suddenly thought, \ (C_i \) value is small, and if \ (C_i = 0 \) , is a direct proportion function of two, as long as the number of symbols is substituted into the same symbol does not change.
If the absolute value so after the excitement reaches a certain size, let \ (c_i \) can no longer make a few changes this number, then there is no problem that can occur when the minimum requirements. Then when the small absolute value calculation when there is no legal force, a large absolute value when positive and negative, respectively, recording the maximum value, the minimum value can. Because of \ (n, c \) is very small, as long as the value \ ([- 225, 225] \) when violent enough memory (even larger slope of each \ (1 \) , the intercept \ ( 15 \) have no way to change sign). Complexity \ (O (n-450 * 2 ^ n-*) \) , but not strictly, also loose time, able to live.

It took about \ (1h20min \) code over, once, to do the second question.

The second question

Title face: a \ (the DAG \) , the source point \ (1 \) , required to give the title according to a \ (the DAG \) spanning tree, the root of \ (1 \) . \ (q \) once asked \ ((A, b) \) , to ensure that the tree \ (a \) to \ (b \) ancestors, asked to delete a tree \ (a \) to \ (b \) simple after the side of the path, \ (DAG \) on the \ (1 \) starting \ (b \) subtree how many points can not be reached, independent inquiry.

\(n,m,q\leq 10^5\)

Taking into account, \ (DAG \) remove a class \ (Dfs \) what is left of the spanning tree, staggered side to side and front.
Then you are looking forward edge, may be useless when you delete the ancestral chain, depends on the specific deleted to where; as for staggered side, the starting point is not the end of their ancestors, so delete ancestors did not affect the chain, as if at any moment You can come (here \ (Flag \) ,After the discovery was wrong)? So consider asking what it was like.

Finally able to come a point, apparently several sub-trees, each sub-tree root before use to go over the side edges and staggered position is deleted (ie, \ (A \) above the point). Then we should use their position to jump to the lowest depths possible. Then there may be staggered edge directly to the root (here or \ (Flag \) ,After the discovery was wrong), Has a depth lowest position on the forward side and the front side refers to the point that can be reached to take shallower.

Then seek the answer to how demand? May maintain one segment tree for each subtree, \ (I \) segment tree point number, subscripts \ (J \) values are stored point: Delete \ ((fa [i] [ j], i ) \) when the answers, \ (fa [i] [j ] \) represents \ (i \) go up \ (j \) ancestor of edges.

So we asked Offline placed on each point, the only requirement for each point above the tree line to the sub-tree root. How to consider seeking? First of all, if \ (i \) can not reach (deleted sides reached a \ (i \) with forward edge and staggered to the side can lightest ancestors), the answer should be the son and the direct segment tree merge! Then \ (i \) to reach the shallowest ancestor if not removed, the entire \ (i \) of the sub-tree can be reached, then all this part can be directly assigned \ (0 \) .

It looks pretty simple, crackling start playing. Test samples, all over, submission, refresh, \ (WA \) , \ (0pts \) .

I was stupefied \ (QAQ \) , write a violence ready to shoot. Finished suddenly found I will make a \ (DAG \) ? \ (1 \) number can also point to all points? Asked also to ensure that the ancestors? Thus a painfully hit data range barely meet weak producer, \ (n-\) in \ (10 \) within really shot out. Then finally found a staggered side does not necessarily go to \ (LCA \) to delete the die. Ponder, found staggered edge \ ((u, v) \ ) in the \ (u \ rightarrow LCA (u , v) \) This chain can easily go, and in fact before it can unite the edges. Going up the shallowest point ancestors should have taken on this chain better. Thus topological sort seek out the most shallow point, multiplication maintenance \ (the LCA \) and the minimum value, and then put back the segment tree merge, not much to change the content.

Then finally hit \ (200 \) line, after a full test data submitted, \ (AC \) , and comfortable.

The results of such a toss, no time to look at the third question ...... \ (GG \)

The third question

Surface problem: a tree right point, right point composition \ (1 \ cdots n \) arranged, \ (m \) times query, given a path, the path on the right to form a sequence of point values, asked how many bubble sort sequences satisfy this sequence is equal to k wheel, \ (\% 998 244 353 \) .
Data range: \ (n-, m, k≤5. 5 * 10 ^ \)

No time plus the questions are too god, I took the \ (5pts \) violence left.

The examination room

\ (Day2 \) is \ (100 + 100 + 5 = 205 \) , share a moment as if the public regarded minutes, go back to rest.

\ (Day2 + \)

Project title, \ (Cache \) , see study manual read \ (30min \) , is still basically confused, probably read some of the two implementations, one \ (Cache \) replacement algorithm, another is more than \ (Cache \) is \ (MESI \) algorithm.

The first question is, \ (MESI \) large analog, looks very simple, ready to do.
Since the study manual does not tell me where to read and write operations are read and write, I tangled for a long time is changed \ (Cache \) or change of main memory, and ultimately probably know that change \ (Cache \) .
I thought he was doing a basic understanding, started to play, and probably do is to follow the instruction manual, but it made it very fans, and for the first question, some steps to no avail. Debugging spent nearly finished + \ (1.5h \) , I found that many mistakes. The first is the manual contains some statements did not represent a function in English, did not see the cause. The expression while there \ (the Flush \) have \ (Flushopt \) , and \ (Flushopt \) does not pass inside the subject values, this operation is still to be output. The \ (Flush \) is entitled to join the study manual which no action. So I put two operations the same as the sample ...... but too much water, do not show these details. I do not know what something is, also made no small data.

Finally \ (WA \) a \ (5 \) sent to the tune finally, to get \ (40 \) points. Look at the second question found the flood problem, \ (Cache \) replacement operation while achieving more. A write, after all, just one more multi \ (8 \) points, the last a \ (16 \) points.

However finish left \ (15min \) , we discovered a problem input. The original input is (16 \) \ binary number, I do not come in with a quick read input. So read into a string, the result of brain smoked written in binary, but also to sample the water before, but hand opinions \ (WA \) . When finally found, only \ (3min \) , and to determine the letters and numbers in both cases, did not finish ...... \ (GG \)

The examination room

Only to find himself a man of a question, the latter subject is not hard, but also a good understanding ......

\ (Day3 \)

Informal players did not receive an interview, playing a morning in the hotel, and then fly back.
Other students have got very good about, but said the issue about all over the place, a little worried about worthless.

The performance was barely two days before it ...... pretty public, most of the explosion \ (Day2 + \) did not arrange a good time, and do not read the material started to play the code, leading to a simple question behind the loss of points.

Guess you like

Origin www.cnblogs.com/ModestStarlight/p/12098355.html