Comet OJ - Contest # 11 & solution to a problem after the game summary

Solution of Comet OJ - Contest #11

A.eon

-Problem designed by Starria-

10 die in the sense, the answer becomes the least significant bit of the largest number (ie, the minimum number of digits of the original) and the least significant bit of the original number of poor.

S $ $ order input numeric string, the answer is $ (\ min_ {i = 1} ^ {n} S_i-S_n)% 10 $.

Time complexity $ O (n) $.

B.usiness

-Problem designed by Winniechen-

This is obviously a very dynamic programming problem.

Make $ g_ {i, j} $ denotes the $ i $-day, hands of $ j $ nodes, the maximum number of nodes will be returned.

Of $ I $ day process of obtaining the node is transferred to $ g_ {i, j + f_j} = \ max (g_ {i, j + f_j}, g_ {i-1, j}) $, and for the storage node procedure just for each storage can do a full backpack.

C.elebration

-Problem designed by Starria-

Defines a length not exceeding $ \ frac {n-1} {2} $, and no segment is repeated legal color segments. Furthest right point to record $ pre_x $ to $ x-1 $ is a legitimate right end point of the segment furthest left point, $ nxt_x $ to $ x $ is the left end point of the legal section.

Enumeration of the title face triplet $ a, b (a <b \ le nxt_a + 1) $, $ c $ is legitimate is $ (b, nxt_b + 1] $ and $ [pre_ {a} , n-] $ intersection. That is, when the $ pre_ {a}> when nxt_b $, $ b $ contribution $ nxt_ {b} + 2-pre_ {a} $.

Moved to the right each time $ a $, will contribute $ (nxt_a + 1, $ b $ within nxt_ {a + 1} +1] $ interval hanging $ nxt_b $, moving $ pre_ {a} $ when after subtracting the contribution can be.

Temporal complexity $ O (n) $.

Using the data structure can simply maintain the intersection,This is where the card was lostI did not bother to card.

D.isaster

-Problem designed by Winniechen-

FIG difficult for a process, it is considered to simplify the drawing, establishing a direct spanning achieve the original effect.

Because when we ask, requiring only go number $ \ le y $ of the point, so to retain the number of points at both ends of the side $ \ max $ should be as small as possible, so there are more sides can be used once asked .

So we will follow the edge $ \ max $ sort of end points, the establishment of a kruskal reconstruction tree . (This does not resolve itself)

On the basis of maintaining a tree line and a multiplier array, each time the highest point kruskal reconstruct the tree can reach to find, and then ask the sub-tree product and modify directly modified.

E.ffort

-Problem designed by Winniechen-

Assume that the total number of attacks is $ k $, then we take this $ k $ times the same attack assigned to the $ n $ different people, according to law flapper look that is inserted in this $ n $ k $ in attack $ boards. Just make note of the number of attacks is $ k $ solution for $ ans_1 $, flapper method for the $ ans_2 $, $ k $ contribution shall be $ ans_1 \ times ans_2 $.

Maintenance $ k $ order term coefficient as a second $ I $ species frequency data structure attack interpolation scheme $ k $ plates of the polynomial $ F_i (x) $, then the $ [x ^ k] F_i ^ {a_i} (x ) $ $ I $ is the first species in the interpolation number $ k $ embodiment of the plates.

Since we only have $ n $ plates, so the length of the polynomial never exceed $ n $. Mold $ x ^ {n} $ do polynomials quickly sense the power, then the final $ m $ polynomial can be combined.

Can achieve the best overall complexity $ O (nm \ log n) $, std written $ O (nm \ log n \ log a_i) $.

F.arewell

-Problem designed by negiizhao-

$ $ E_S make a point representing the number of sides of the inner set $ S $, $ E_ {S, T} $ denotes the number of edges, $ F_S between $ S and $ T $ $ $ $ $ S represents the number of programs is a DAG.

Enumeration of the 0 degree point set $ T $, to transfer $ F_S = \ sum_ {T \ subseteq S, T \ neq \ varnothing} (- 1) ^ {| T | -1} F_ {S \ backslash T } 2 ^ {E_ {T, S \ backslash T}} $.

Each of the sub-$ S $ 0 degree set point is set are counted once, their repellent capacity can be obtained simply coefficients $ (- 1) ^ {| T | -1} $, the coefficient $ 2 ^ {E_ { T, S \ backslash T}} $ from $ S \ backslash T \ rightarrow T $ broken edges or points only $ T $.

DAG count for little understanding of people from here can start reading

\ Sout {DAG to count some understanding can start reading from here}

$ 2 ^ {E_ {T, S \ backslash T}} $ can be written $ 2 ^ {E_S} -2 ^ {E_T} -2 ^ {E_ {S \ backslash T}} $, and therefore into the original formula $$ \ frac {F_S} {2 ^ {E_S}} = \ sum_ {T \ subseteq S, T \ neq \ varnothing} \ frac {(- 1) ^ {| T | -1}} {2 ^ {E_T}} \ ast \ frac {F_ {S \ backslash T}} {2 ^ {E_ {S \ backslash T}}} $$

Of the above equation for a subset of the convolution can.

DAG count for little people can understand from here to read $ \ surd $

CompetitioninRearMake complaintsto sum up

  • BY Winniechen&Starria

Some people Tucao title

  • Why had no one 10min B (at time of 10min
  • Why does everyone have been in D Wa ah!
  • Why would anyone write Fenwick tree ah!
  • CD is not the reverse order out ah ...... (this is Starria pot!
  • B seems difficult out (manual nugget)
  • How someone lies less than 1h the F!
  • (F card looks like a ... man constant.
  • I heard that some people think the problem face is not good, I do not think so
  • 1.5h when a blood six questions are finally out, which makes the topic and people are very excited
  • 2h when someone finally A out of the five questions
  • 2h 10min when, finally have> 10 people cut the four questions
  • 2h 23min when, finally there is a second man cut the E!
  • In the last 10min and found supy of F is often a card
  • Then finally there was only one AK game player!
  • Finally it looks, CD upside down, EF upside down

  • Why D questions we have not found $ a_i, v \ le 10 ^ 9 $ large than $ 998 244 353 $
  • $ B $ question why so many people so much hair wa
  • Why C title topic people so cancer
  • Why will face a problem in this way
  • Please look forward to the video solution to a problem the day after tomorrow night, when the topic of people Winniechen and Starria will explain the questions for everyone, and to answer some of the scenes!

The topic of people some self-reflection and frank summary

  • In fact, the original title not like this, just three days, F algorithm appears before the exam question, today was a good F of this data, so people feel sorry
  • Data for each question are dreamoon strengthen too, I had my data vegetables to death
  • Then two (three) out of question people are pigeons, are able to drag
  • The main person in charge (Winniechen) most of the time can not be passed timely information, and does not refer to the topic Manual topic, let AA sister and other staff feel tough, and I apologize
  • Thank you for your support!
  • The topic of people's QQ: Winiechen 1967199892, Starria 972808330

Guess you like

Origin www.cnblogs.com/Winniechen/p/11566727.html