×

# Need help for this question #271 Div 2 D

 0 How to solve this problem ? I cant even understand the sample input. asked 26 May '17, 18:25 2★chari407 448●2●7 accept rate: 0%

 1 This is a DP problem. Since a and b can be atmost 10^5 and k is fixed you can precompute all values upto 10^5 . For i< k dp[i] is 1 and for i>=k you can add a R or W at the end. If you add R the previous value can be R or W.If you add a zero the previous k-1 must be zero for valid configuration. So dp[i]=dp[i-1]+dp[k-1]. answered 27 May '17, 10:20 6★sdssudhu 1.1k●3●10 accept rate: 15%
 0 Can someone help me please ? answered 27 May '17, 08:50 2★chari407 448●2●7 accept rate: 0% Read the editorial here : http://codeforces.com/blog/entry/14136 (27 May '17, 11:23)
 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:

×671

question asked: 26 May '17, 18:25

question was seen: 316 times

last updated: 27 May '17, 11:23