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

×

KESHOW CHALLENGES AMIT - BIG(O)

Can any one help me with this problem ? I cannot understand the algorithm .

asked 03 Apr '15, 08:27

shakil_ruet's gravatar image

5★shakil_ruet
112
accept rate: 0%


this problem is directly solved using matrix exponentiation
first we need to write the recurrence in matrix form
|a b c 1| x |t(n-1)|
|1 0 0 0|   |t(n-2)|
|0 1 0 0|   |t(n-3)|
|0 0 0 1|   |d     |
then find pow(n-3) binary exponentiation
if u cant understand this see this link:http://zobayer.blogspot.in/2010/11/matrix-exponentiation.html
link to my solution:http://www.codechef.com/viewsolution/6610526
link

answered 03 Apr '15, 12:57

pallesai's gravatar image

4★pallesai
176830
accept rate: 17%

edited 03 Apr '15, 12:59

@shakil_ruet The editorial will be posted by tonight

link

answered 03 Apr '15, 17:19

dragonemperor's gravatar image

3★dragonemperor
89321135
accept rate: 10%

@shakil_ruet the editorial has been posted

(03 Apr '15, 19:52) dragonemperor3★

Thanks for the help :) @dragonemperor and @pallesai

link

answered 03 Apr '15, 23:47

shakil_ruet's gravatar image

5★shakil_ruet
112
accept rate: 0%

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:

×105

question asked: 03 Apr '15, 08:27

question was seen: 817 times

last updated: 03 Apr '15, 23:47