ADVITIYA2 - Editorial

PROBLEM LINK:

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

Author: ladchat
Tester: apoorv_me
Editorialist: iceknight1093

DIFFICULTY:

TBD

PREREQUISITES:

None

PROBLEM:

At least 4 judges out of 5 must like a person’s performance for them to qualify to the next round.
Given the responses of all judges, find out whether Anuj qualifies.

EXPLANATION:

You’re given 5 numbers, and at least four of them should be ones.
The simplest way to check this is to sum up all the numbers, then check if this sum is at least 4.
That is, the answer is Yes if and only if R_1 + R_2 + R_3 + R_4 + R_5 \geq 4.

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Editorialist's code (Python)
for _ in range(int(input())):
    print('Yes' if sum(list(map(int, input().split()))) >= 4 else 'No')