Data Structures & AlgorithmsHardICPC regional · Codeforces Div2 B
Problem: What is the remainder when 2^100 is divided by 9?
- A. 4
- B. 7
- C. 2
- D. 1
Correct answer: B. 7
2⁶ ≡ 1 (mod 9) and 100 ≡ 4 (mod 6), so 2¹⁰⁰ ≡ 2⁴ = 16 ≡ 7. 4 is just the reduced exponent, reducing the exponent mod 9 gives 2¹ = 2, and 1 assumes 6 divides 100.
More Coding Interview Problems questions
- Problem: The sum of all three-digit palindromic numbers (100–999) is what value?
- Problem: How many integers n with 0 ≤ n ≤ 255 have exactly four 1-bits in their binary representation?
- Problem: What is the largest power of 2 that is less than or equal to 1000?
- Problem: Find the smallest positive integer x such that floor(x/2) + x is at least 50.
- Problem: A set of jobs has deadlines and profits: (deadline 1, profit 20), (deadline 2, profit 40), (deadline 2, profit 30), (deadline 3…
- Problem: The insertion sort is applied to [3, 1, 2]. Count the total number of element moves (each shift of an element one place to the…