PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: rudra_1232
Tester: kingmessi
Editorialist: iceknight1093
DIFFICULTY:
Cakewalk
PREREQUISITES:
None
PROBLEM:
You have a time machine that can send you forward at most 25 years.
The current year is X. Can you reach year 2050?
EXPLANATION:
Since you can go forward at most 25 years, the maximum year that can be reached is X + 25.
So,
- If X + 25 \lt 2050, it’s not possible to reach the target year and the answer is
"No"
. - Otherwise, it’s possible to reach 2050 and the answer is
"Yes"
.
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (PyPy3)
x = int(input())
print('Yes' if x + 25 >= 2050 else 'No')