Saturday, June 2, 2012

TCO 2C

My last round in TCO, and finally I got one problem correct.

p300 looks doable by just brute-force all possible choices. However search from 1 to 9999 might be too slow. A minute of thinking makes you realize that you only need to try all possible out-edge weight +1,0,-1, and that's all. The rest is just implementation which took me about 40min.

p500 and p900 all look doable, at least I understand the problem statement. The problem is, how to do it fast? Need to read the editorial, I guess.

In terms of difficulty, 2C is easier than 2A and 2B, at least it seems to me. There are quite some people finishing all 3. I have yet to make my first successful p500 submission.

No comments:

Post a Comment