• + 0 comments

    The given constraint C_i < M is just... wrong.

    This problem is no fun to solve without a reasonable and correct constraint on the number of distinct roads there are. If the lengths are all distinct powers of 2, then there really can't be more than 64 of them without forcing the program to use arbitrary-length integers.