• + 1 comment

    For all but 3 of the test cases, it is possible (in C) to pass essentially by counting one-by-one the valuations that satisfy the requirements without timing out; you just have to do a tiny amount of work to minimize the amount of time spent on failed valuations.