×

# Solution for solving the Practice Contest

 1 What is solution idea for the Solving the Practise Contest ? Is it related to finding recurrence and solving in O(log n) using exponentation or can it be solved using combinatorics ? asked 02 Nov '14, 13:03 66●3 accept rate: 0% 0★admin ♦♦ 19.8k●350●498●541

 3 Yes, the problem can be solved by finding a recurrence relation and then using matrix exponentiation. The DP state is: DP[i][x][y][z] represents the number of ways of distributing i problems such that x is the number of problems done by first mod k. (0 <= x < k) y=0 means second has not done the current problem and y=1 means the current problem is given to second. (0 <= y < 2) z=0 means third has done 0 problems till now and z=1 means that third has done at least one problems till now. (0 <= z < 2) We made a matrix of 40x40 (10 * 2 * 2) for the matrix exponentiation. answered 02 Nov '14, 20:12 1.5k●8●21●30 accept rate: 0%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported
• mathemetical formulas in Latex between \$ symbol

Question tags:

×1,112
×33

question asked: 02 Nov '14, 13:03

question was seen: 1,173 times

last updated: 01 Dec '14, 19:59