Educational Codeforces Round 71

Contest Info


Practice Link

Solved A B C D E F G
7/7 O O O O O O Ø
  • O through the game
  • Ø After the game by
  • ! I tried but failed
  • - No attempt

Solutions


A. There Are Two Types Of Burgers

Sign.

B. Square Filling

Sign.

C. Gas Pipeline

Meaning of the questions:
given a \ (01 \) string, the one who is \ (1 \) indicates that there is a need for a highly \ (2 \) flyover, if \ (0 \) indicates that only requires a height of \ (1 \) is.
But all of bridge is needed to connect, and the height of the head and tail must be \ (1 \) .
But the different costs and mounting costs of the bridge, find the least cost.
Overpass like this:

Ideas:
First part of the bridge cost is fixed.
What difference is it takes time to bridge go down, walk up, or choose the direct use of stents to hold up, tiled in the past.
For each (0 \) \ consecutive segments judge what you can, take a small portion of the cost

D. Number Of Permutations

The meaning of problems:
given \ (n-\) th tuple \ ((a_i, B_i) \) , asked how many rearranged such that the first program key of view it is not non-decreasing and a second key it does not look at non-decreasing

Ideas:
being the anti difficult, considering how much the number of programs to make the first point of view it is non-decreasing keyword or keyword to the second point of view it is non-decreasing.
So that is about inclusion and exclusion is based on the number of keywords to see the first non-decreasing + keyword to see it a second non-decreasing - decreasing the number of solutions to both of these keywords to see which are non-
then subtract the total it can

E. XOR Guessing

The meaning of problems:
there are a number \ (X (X \ in [0, 2 ^ {14} -. 1]) \) , you can ask twice asked \ (100 \) number \ (a_i \) , the system each randomly select a number \ (a_i \) , to tell you (x \ oplus a_i \) \ results.
You need to ask two results, the \ (x \)

Thinking:
note needs to be given every \ (100 \) number, found \ (2 ^ 7 = 128 \)

  • So after a few inquiries to ensure that the first \ (7 \) bits are all \ (0 \) after, then we can determine (7 \) \ result bits
  • Number of guarantee before the second query \ (7 \) bit is \ (0 \) , before it can be determined \ (7 \) bit value

F. Remainder Problem

The meaning of problems:
given a length \ (500,000 \) sequence \ (a_i \) , at the start \ (= a_i 0 \) , supports two modes of operation:

  • The \ (a_x \) becomes \ (a_x + y \)
  • Calculated for all \ (i \% y = x \) a \ (a_i \) and.

Thinking:
Block can.

G. Indie Album

Ali typewriter

Guess you like

Origin www.cnblogs.com/Dup4/p/11406992.html