Tuesday, October 16, 2012

CF 145 div2

For some time I thought I could do div1 A and B, and in div2 I can usually finish everything except E. Now I am in a situation that I can do only A,B for div2. Haven't been in timed competition for a while.

Last night was CF145 with ICPC rule. It started at midnight so I was tired from the beginning. Finished 4 out of 8, although the top scorer finished all 8 within 1.5h. The contest length was 3.5h. I spent 2.5h then do not see how to solve the rest.

B,C,D,E were simple problems that you just need to implement the right thing.

A, F, G, H I finished today.

A: You want to place students into desks such that the two sharing a desk cannot have id +1 or -1, and they cannot be RL. This was easy, just pair i, i+n/2. Another way would be i, i+2. If we have RL, we change it to LR.

F: DP. try to paint each block left to right, for each one, try R or G and keep track of current cost.

G: If you work out n=2, 4, 8, there is a pattern.

H: Merge the block of zero and one, then check the number of blocks in the merged sequence. The number of flips is the number of blocks, or minus one if the bottom is zero already.

No comments:

Post a Comment