Data Structures & AlgorithmsVery hardICPC regional · Amazon SDE OA

How many integers from 1 to 200 inclusive have exactly 3 positive divisors?

  1. A. 7
  2. B. 46
  3. C. 6
  4. D. 14

Correct answer: C. 6

Numbers with exactly three divisors are squares of primes. Counting primes p with p squared at most 200 gives the answer, since 14 squared exceeds 200 but 13 squared does not.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic