CWC23QUALIF - Editorial

PROBLEM LINK:

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

Tester: iceknight1093
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

A team that scores 12 or more points in the group stage qualifies for the next stage.
A certain team has X points. Will they qualify?

EXPLANATION:

As the statement says, the answer is Yes if X \geq 12 and No otherwise.
Check this using an if condition.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
x = int(input())
print('Yes' if x >= 12 else 'No')

Problem: Cricket World Cup Qualifier (CWC23QUALIF)

Problem Summary:
We are given a number X which represents the points of a team.
A team qualifies for the next stage if X >= 12.

Logic:
We just check if X is greater than or equal to 12:

  • If true β†’ print β€œYes”
  • Otherwise β†’ print β€œNo”

Code (in C):

include <stdio.h>

int main() {
int X;
scanf(β€œ%d”, &X);

if (X >= 12)
    printf("Yes\n");
else
    printf("No\n");

return 0;

}

:clock3: Time Complexity: O(1)
:package: Space Complexity: O(1)

:white_check_mark: Simple condition check β€” direct and efficient!

1 Like