Data Structures & AlgorithmsVery hardICPC regional · Codeforces Div2 B

Problem: Compute (7^2026 + 11^2026) mod 1000, where ^ is exponentiation.

  1. A. 410
  2. B. 1410
  3. C. 224
  4. D. 10

Correct answer: A. 410

pow(7, 2026, 1000) = 649 and pow(11, 2026, 1000) = 761, and (649 + 761) mod 1000 = 410. Forgetting the final reduction gives 1410, computing (7 + 11)^2026 mod 1000 gives 224, and working mod 100 keeps only the last two digits (10).

More Coding Interview Problems questions

Exams that ask this topic