2019-2020 Saint-Petersburg Open High School Programming Contest (SpbKOSHP 19)

2019-2020 Saint-Petersburg Open High School Programming Contest (SpbKOSHP 19)

  • easy: ABFGHI
  • medium-easy: CE
  • medium: JK
  • ?????: D

Problem A. King’s Inspection

Sign.

Problem B. Cash Gap

greedy.

Problem C. Jet Trains

T disjoint-set maintenance edge connectivity, for each block in communication with the set maintenance of the communication block is connected to the outside from the F side. heuristic set to merge. Complexity \ (O (n (logn) ^ 2) \)

Problem D. Cutting Pizza

Not so hard.

Problem E. Unique Solution

  • To \ (a_i \ neq 0 \) location assigned the next highest power of 2 number.
  • eg 1 0 -1 1 0 0, years =2^5 2^2 -2^4 2^3 2^1 2^0
  • The condition of inequality with equality, \ (a_i \ NEQ 0 \) position can be restrained.
  • In other solution \ (a_i = 0 \) variable position certainly is \ (0 \) , otherwise lowbit summed disintegrated.

Problem F. Metro 2345

Shortest

Problem G. Weight Overflow

Find two equal sum collection. Pay to throw away.

Problem H. Checking Answers to Test

Simulation with the meaning of problems.

Problem I. Magic Trick

Problem J. Superpermutations

Problem K. Preparing Tests

Two-pointer left seeking maximum right point for each point, it is necessary to delete plus side while maintaining connectivity, to the LCT.

summary and replay

  • CB has blown up, remember to save.
  • K title misread the title, I remember watching a sample explanation.
  • E correctness did not consider a good start.

Guess you like

Origin www.cnblogs.com/FST-stay-night/p/11779611.html