SUPCHEF - Editorial

PROBLEM LINK:

Contest - Division 3
Contest - Division 2
Contest - Division 1

DIFFICULTY:

CAKEWALK

PROBLEM:

Chef’s exam will start M minutes from now. He wishes to watch a series of N episodes, each K minutes long.

Determine if it is possible for him to watch the entire series strictly before his exam begins.

EXPLANATION:

Since each series is K minutes long, chef will require a total of N*K minutes to watch all N episodes of the series.

Therefore, it is only possible to watch the entire series before his exam begins if, the total time to watch the series is less than the time remaining for the commencement of the exam \implies N*K < M.
Output YES if the above equality holds, and NO otherwise.

TIME COMPLEXITY:

O(1)

per test case.

SOLUTIONS:

Editorialist’s solution can be found here.


Experimental: For evaluation purposes, please rate the editorial (1 being poor and 5 excellent)

  • 1
  • 2
  • 3
  • 4
  • 5

0 voters