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

×

Please help find an error in my code

I have used the logic in the editorial but I have made some mistake in it. I searched but couldn't find it. Please help

problem
My code

asked 30 Jul '15, 16:22

dragonemperor's gravatar image

3★dragonemperor
89321135
accept rate: 10%

edited 28 Aug '15, 16:58

admin's gravatar image

0★admin ♦♦
19.8k350498541


Hey dragonemperor, you can refer to the editorial of the problem here. It will help you understand the mistake you are making.

link

answered 28 Aug '15, 16:59

admin's gravatar image

0★admin ♦♦
19.8k350498541
accept rate: 36%

I think the problem lies in your implementation regarding finding the initial matrix. You should use another matrix to find the matrix C, described in the editorial. Since you are finding the matrix in the same matrix itself the values are been modified and the 2nd loop you execute stores faulty values.

Here is a link to my solution https://www.codechef.com/viewsolution/7944592

link

answered 28 Aug '15, 23:02

likecs's gravatar image

6★likecs
3.7k2481
accept rate: 9%

edited 28 Aug '15, 23:54

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:

×3,820
×2

question asked: 30 Jul '15, 16:22

question was seen: 489 times

last updated: 28 Aug '15, 23:54