Monday, May 4, 2009

Continue solving problems at the hotel :)

1020. Rope (timus.ru)
This problem was a subproblem of one of the questions during last World Finals 2009 in Stockholm. The solution here is simple - the length of the rope is sum of the segments lengths and 2*PI*R because you're doing full circle.

1021. Sacrament of the sum (timus.ru)
You just assume "perfect" hashing in this problem (since there are only at most 50,000 integers in one of the lists) So, you hash the first list A, and then go through the second list B and check if 10000-B[i] is present.

No comments:

Post a Comment