Algorithm in jobdu online judge