Data Structures & AlgorithmsHardGATE CS · Codeforces Div2 B

How many integers x with 1 <= x <= 100 satisfy x^2 mod 24 = 1?

  1. A. 34
  2. B. 33
  3. C. 32
  4. D. 36

Correct answer: B. 33

Residues mod 24 whose square is 1 are exactly the units that are their own inverse. Counting residues first avoids checking every x by hand.

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

Exams that ask this topic