HEALSE - Editorial

PROBLEM LINK:

Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4

Author: fremder
Tester: wasd2401
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

A student is said to have a healthy sleep if they get exactly 8 hours of sleep.
Given H — the number of hours a student has slept — decide whether their sleep amount is too little, too much, or perfect.

EXPLANATION:

Simply do as the statement says.

  • If H = 8, print Perfect.
  • If H\lt 8, print Less.
  • If H\gt 8, print More.

These checks can be made using if conditions.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
h = int(input())
print('Perfect' if h == 8 else ('Less' if h < 8 else 'More'))