THREEQ - Editorial

PROBLEM LINK:

Contest - Division 3
Contest - Division 2
Contest - Division 1

Setter: Jatin Khandual
Tester: Anshu Garg

DIFFICULTY:

CAKEWALK

PROBLEM:

Given A_1, A_2, A_3 and B_1,B_2,B_3, all either 0 or 1. Determine if the number of 0's in \{A_1,A_2,A_3\} is equal to the number of 0's in \{B_1,B_2,B_3\}.

EXPLANATION:

Recall that the saint is only interested if the number of Yes’s to his 3 questions matches the number of Yes’s the hero blurts out.

Thus, simply count the number of Yes’s in the hero’s responses and check if it is equal to the number of Yes’s the saint required!

TIME COMPLEXITY:

O(1) per test case.

SOLUTIONS:

Editorialist’s solution can be found here


Experimental: For evaluation purposes, please rate the editorial (1 being poor and 5 excellent)

  • 1
  • 2
  • 3
  • 4
  • 5

0 voters