PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: notsoloud
Tester: raysh07
Editorialist: iceknight1093
DIFFICULTY:
TBD
PREREQUISITES:
None
PROBLEM:
Chef runs a marathon and finishes in X hours. Find which medal he gets.
EXPLANATION:
Simply implement what the statement says, using if conditions.
- If X \lt 3, the answer is
Gold. - If 3 \leq X \lt 6, the answer is
Silver. - Otherwise, the answer is
Bronze.
TIME COMPLEXITY
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (Python)
x = int(input())
if x < 3: print('Gold')
elif x < 6: print('Silver')
else: print('Bronze')