SummerSky's blog

By SummerSky, 7 years ago, In English

200B - Drinks

Straightforward implementation.

200C - Football Championship

Instead of figuring out an explicit formula to calculate the required answer, we can simply adopt two loops to implement an exhaustive search to find out it.

The first loop enumerates the value d = X - Y, from d = 0 to d = 100 (100 is large enough to cover all the cases), and the second loop deals with Y = 0, 1, ..., 100. Within the inner loop, we compute the scores, goals and missed goals for each team, and sort them according to the given rules. Once finding that the team is in top 2, we can immediately output the current Y and X = d + Y as the answer.

200D - Programming Language

The main idea is exhaustive enumeration, and be careful when deal with the strings.

  • Vote: I like it
  • -8
  • Vote: I do not like it