@@ -0,0 +1,843 @@
+%0AN = int(raw_input())%0Acalculations = %5B%5D%0Afor _ in xrange(N):%0A    startDay, duration = %5Bint(j) for j in raw_input().split()%5D%0A    endDay = duration + startDay - 1%0A    calculations.append(%5BstartDay, duration, endDay%5D)%0A%0A%0Adef sortEndDate(x, y):%0A    # Sort the list thanks to the end of the computation%0A    if (x%5B2%5D %3E y%5B2%5D):%0A        return 1%0A    elif (x%5B2%5D %3C y%5B2%5D):%0A        return -1%0A    else:%0A        return 0%0A%0A%0Adef nbScientists(calculations):%0A    count = 0%0A    upperBound = -1%0A    for c in calculations:%0A        # If the beginning of the calculation is not in%0A        # the already booked period%0A        if (upperBound %3C c%5B0%5D):%0A            # Add this calculation%0A            count += 1%0A            # The upper bound is now its end date%0A            upperBound = c%5B2%5D%0A    return count%0A%0Acalculations.sort(sortEndDate)%0Aprint nbScientists(calculations)%0A

Add exercise Super Computer