Paul's technique is how I solved Bathroom stalls. Because there can be a
very large number of stalls, you can't simulate every stall, but if you
just keep track of how many intervals of empty stalls of each size that
there are, then you can do all intervals of one size at once (which all
split the
I shared your intuition, but actually it's incorrect.
Start with N=23. Add a person.
Now you have 2 gaps of size 11. Add two people.
Now you have 4 gaps of size 5. Add four people.
Now you have 8 gaps of size 2.
You've added seven people already. You'll add eight more before you get to
the last
500 255.
First step, the 500 turns into a 250 and a 249 (k=1)
Second step, the 250 turns into a 125 and 124, and the 249 turns into 2
more 124s (k=3)
Third step, the 125 turns into 2 62s, the 3 124s turn into 3 62s and 3 61s
(k=7)
Fourth step, the 5 62s turn into 5 31s and 5 30s, the 3 61s turn
Hi,
I am trying to figure out why my solution wasn't right.
I couldn't even solve Small Input 1 and now I took someones solution from the
scoreboard who solved it and when I compared my output with that one (on
C-small-1-attempt0.in) I found out that on 100 cases my output is different on
5 of
I am trying to figure out why my solution wasn't right.
I couldn't even solve Small Input 1 and now I took someones solution from the
scoreboard who solved it and when I compared my output with that one (on
C-small-1-attempt0.in) I found out that on 100 cases my output is different on
5 of