You are not logged in. Please login at www.codechef.com to post your questions!

×

Need help for this question #271 Div 2 D

How to solve this problem ? I cant even understand the sample input.

asked 26 May '17, 18:25

chari407's gravatar image

2★chari407
44827
accept rate: 0%


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].

link

answered 27 May '17, 10:20

sdssudhu's gravatar image

6★sdssudhu
1.1k310
accept rate: 15%

Can someone help me please ?

link

answered 27 May '17, 08:50

chari407's gravatar image

2★chari407
44827
accept rate: 0%

Read the editorial here : http://codeforces.com/blog/entry/14136

(27 May '17, 11:23) hemanth_16★
toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • 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