PROBLEM LINK:
Practice
Contest: Division 1
Contest: Division 2
Contest: Division 3
Contest: Division 4
Author: raysh07
Tester: iceknight1093
Editorialist: iceknight1093
DIFFICULTY:
TBD
PREREQUISITES:
None
PROBLEM:
Your favorite team won A games, drew B games, and lost C games.
A win receives 3 points, a draw receives 1 point, and a loss receives 0 points.
How many points did your team receive in the end?
EXPLANATION:
Each win is worth 3 points, so A wins is worth 3A points.
Each draw is worth 1 point, so B draws are worth B points.
Losses don’t contribute to points, so they can be ignored.
The answer is hence
3A+B
TIME COMPLEXITY:
\mathcal{O}(1) per testcase.
CODE:
Editorialist's code (PyPy3)
a, b, c = map(int, input().split())
print(3*a + b)