ICECONE - Editorial

PROBLEM LINK:

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

Author: yash_daga
Tester: mexomerf
Editorialist: iceknight1093

DIFFICULTY:

cakewalk

PREREQUISITES:

None

PROBLEM:

Chef has X cones and Y scoops of ice-cream. How many ice-cream cones can he make, using one of each?

EXPLANATION:

Each ice-cream cone requires one cone and one scoop.
So, Chef cannot make more than X in total (since he has only X cones), and also not more than Y in total (since he has only Y ice-cream cones).

So, if X \leq Y the answer is X, and if X \geq Y the answer is Y.
This can be easily represented as \min(X, Y).

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (PyPy3)
x, y = map(int, input().split())
print(min(x, y))