Data Structures & AlgorithmsHardICPC regional · Codeforces Div2 B

Problem: The sum of the digits of 2^100 written in base 10 is computed. What is that sum?

  1. A. 107
  2. B. 113
  3. C. 31
  4. D. 115

Correct answer: D. 115

2¹⁰⁰ = 1267650600228229401496703205376, whose digits sum to 115 (Python's big integers make this exact). Using 2⁹⁹ gives 107, 2¹⁰¹ gives 113, and 31 is the number of digits, not their sum.

More Coding Interview Problems questions

Exams that ask this topic