Tuesday, December 30, 2014

ACM 1731. Dill / Укроп

  If all of the pairs from the second pile have a difference which can't be covered by any difference between any pair from the first pile, then we found a solution. If we take the first pile consisting of all elements from 1 to n and the second pile: a set of elements where each differs from the previous one by (n+1) starting from a number bigger than n, all the requirements will be met.


       FULL SOURCE CODE

No comments:

Post a Comment