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


WA on Matrix Again[Closed]

Here is my code: getting wrong answer,tried almost all test cases. Can't figure out the mistake! I bet its something very minute. :(

asked 22 Dec '14, 20:50

h1ashdr%40gon's gravatar image

accept rate: 10%

edited 22 Dec '14, 21:55

Simplify the column sum to:

sum += (a[j][i] + 10000007) % 10000007;

and simplify the column-sum product to:

product = (product * sum) % 10000007;

answered 22 Dec '14, 20:55

sampritipanda's gravatar image

accept rate: 31%

still getting WA somehow..I don't think that should make a big difference. Both the statements mean the same things I guess?

(22 Dec '14, 21:36) h1ashdr@gon3★

Hey bro
Your code gives WA for this test case:

I run this test case on an AC'ed and got this output : 5601080 .
You may check the line by line output from AC'ed code here:


answered 22 Dec '14, 21:46

rishabhprsd7's gravatar image

accept rate: 14%

Two things! 1) I got AC,I wrote the loops in the reverse order :P 2) That AC code gives WA for the input you provided. The correct answer is 7901228. Here is my AC solution : here one of the top AC solutions : both give the same answer :) I don't know how that solution got AC with wrong answer on that test case!!

(22 Dec '14, 21:53) h1ashdr@gon3★

okay sorry for that, i didn't knew about that it AC code is giving WA..
SOrry... :(

(22 Dec '14, 22:09) rishabhprsd72★
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: 22 Dec '14, 20:50

question was seen: 873 times

last updated: 22 Dec '14, 22:09