ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1193. Queue at the Exam

Solve by sorting.
Posted by Mahilewets 30 Jun 2017 00:40
Sort by T1.
Then set timer=0,  ans =0.
Then for all students in sorted order:
if timer<T1 then timer=T1
timer=timer+T2
dtime=timer-T3
if dtime>ans then ans=dtime