BOP1 - Editorial

PROBLEM LINK:

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

Author: kingmessi
Tester: pols_agyi_pols
Editorialist: iceknight1093

DIFFICULTY:

Cakewalk

PREREQUISITES:

None

PROBLEM:

Alice and Bob have X and Y water balloons, respectively.
The player with more water balloons wins. If the counts are equal, it’s a draw.
Predict the winner.

EXPLANATION:

The answer is:

  • Alice, if X \gt Y;
  • Bob, if X \lt Y;
  • Draw if X = Y

These can be checked using if conditions.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (PyPy3)
x, y = map(int, input().split())
if x > y: print('Alice')
if x < y: print('Bob')
if x == y: print('Draw')