PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: Jeevan Jyot Singh
Tester: Hriday
Editorialist: Nishank Suresh
DIFFICULTY:
348
PREREQUISITES:
None
PROBLEM:
A person is said to be sleep-deprived if he sleeps strictly less than 7 hours in a day.
Given that someone sleeps for X hours, is he sleep-deprived?
EXPLANATION:
Simply implement what the statement says using an if condition:
- If X \lt 7, then the person is sleep-deprived, so print “Yes”
- Otherwise, print “No”
TIME COMPLEXITY
\mathcal{O}(1) per test case.
CODE:
Editorialist's code (Python)
for _ in range(int(input())):
print('Yes' if int(input()) < 7 else 'No')