CR #360 Div2 E [Random-based solution]

Revision en3, by Clone3, 2016-06-29 23:23:18

Is there anyone who can prove or disprove my random-based 18809719 solution of this problem?

Short description:

visited[i] on phase j consists of all possible prefix sums that we could have met by collecting coins from left to right.

Example:

{2, 1} is a set of coins, then

visited[0..3] = {{0}, {0, 1}, {0, 2}, {0, 2, 3}}

Suppose that we are looking for value X in visited[K], if we shuffle input many times , then X is gonna be one of prefix or suffix sums on the way to K. (To consider all Suffixes, simply for every X in answer add K - X to the answer)

The question is how many times do I actually need to shuffle input so that I get all values of X with high probability?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English Clone3 2016-06-29 23:23:18 2
en2 English Clone3 2016-06-29 23:22:57 22
en1 English Clone3 2016-06-29 23:22:40 765 Initial revision (published)