JDELAY - EDITORIAL

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2

Setter: Hasan
Tester: Teja Vardhan Reddy
Editorialist: Taranpreet Singh

DIFFICULTY:

Cakewalk

PREREQUISITES:

None at all (what did you expect?? :D)

PROBLEM:

Given N submission’s starting time S_i and ending time J_i, we need to count number of submissions which have delay of more than 5 minutes.

SUPER QUICK EXPLANATION

  •   Answer is number of submissions for which $J_i - S_i >5$ holds.
    

EXPLANATION

When trying to solve a problem, the most basic intuition we need to have is that can we simulate the whole process without getting Wrong answer of Time Limit Exceeded. If answer is yes, we can just Simulate the whole process without wasting time, and find out answer.

In this problem, we can, for every submission, calculate the expected time, so that if submission is judge after this expected time, Submission is delayed.

Expected ending time is same as Actual Starting time + Expected judging time (given 5 minutes in this problem).

So, our final solution becomes, iterate over every submission, see if Actual ending time is later than Expected judging time.If yes, increase answer by 1. Print the final answer.

This is it. You may feel free to refer Solutions if you wish to.

Time Complexity

Since we iterate over all customers only once, Time complexity is O(N).

AUTHOR’S AND TESTER’S SOLUTIONS:

Setter’s solution
Tester’s solution
Editorialist’s solution

Edit: Until above links are not working, feel free to refer solution here.

Feel free to Share your approach, If it differs. Suggestions are always welcomed. :slight_smile:

The number of submissions in this Lunchtime which have a delay of more than five minutes is probably quite high. XD

“You may feel free to refer Solutions if you wish to.”

No. The links don’t work. It happens so often now. @admin

@taran_1407 I think you should put the solutions in the editorial itself, as @vijju123 does.

@the_extractor , that thing is actually little messy, because more often than not it breaks the preview feature for the editorial (you cant check how it looks like when posted on discuss) and makes typing every word slower as discuss takes time to process each character and latex symbol it gets.

Another thing that can be done by the editorialist is to share the solutions as ideone links.

Yes, precisely. Thats the solution I was trying XD

It would be better to post this on contest invitation page rather than editorials page, because admin will surely check invitation page. :slight_smile:

I have posted ideone link for my solution.

1 Like

@taran_1407 It was just meant as a joke, as it’s similar to this problem.

About posting it on the contest announcement page, I don’t think it’ll be of any use. People posted such things about September Cookoff but the admins didn’t reply.

1 Like