COMP4 - Editorial

PROBLEM LINK:

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

Author: raysh07
Tester: iceknight1093
Editorialist: iceknight1093

DIFFICULTY:

Cakewalk

PREREQUISITES:

None

PROBLEM:

You participate in a 4-player chess tournament.
The person at rank i wins 1000\cdot 2^{4-i} rupees.

Your rank is X, how much do you win?

EXPLANATION:

As per the statement, the answer is simply

1000\cdot 2^{4-X}

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (PyPy3)
x = int(input())
print(1000 * (2 ** (4 - x)))