You are not logged in. Please login at 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

My code

asked 30 Jul '15, 16:22

dragonemperor's gravatar image

accept rate: 10%

edited 28 Aug '15, 16:58

admin's gravatar image

0★admin ♦♦

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


answered 28 Aug '15, 16:59

admin's gravatar image

0★admin ♦♦
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


answered 28 Aug '15, 23:02

likecs's gravatar image

accept rate: 9%

edited 28 Aug '15, 23:54

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 30 Jul '15, 16:22

question was seen: 489 times

last updated: 28 Aug '15, 23:54