INSTAGRAM - Editorial

PROBLEM LINK:

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

Author: notsoloud
Testers: iceknight1093, rivalq
Editorialist: iceknight1093

DIFFICULTY:

408

PREREQUISITES:

None

PROBLEM:

An Instagram account is considered spam if it follows at least 10 times more accounts than it has followers.

Given X and Y, the following and follower count of an account, decide whether it is a spam account.

EXPLANATION:

The problem statement states that the given account is spam if and only if X \gt 10\cdot Y

So, simply check this using an if condition:

  • The answer is Yes if X \gt 10\cdot Y
  • The answer is No otherwise

TIME COMPLEXITY:

\mathcal{O}(1) per testcase.

CODE:

Code (Python)
for _ in range(int(input())):
    x, y = map(int, input().split())
    print('Yes' if x > 10*y else 'No')
1 Like