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

×

WA on Matrix Again[Closed]

Here is my code: http://www.codechef.com/viewsolution/5636159 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

3★h1ashdr@gon
2912319
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;
link

answered 22 Dec '14, 20:55

sampritipanda's gravatar image

5★sampritipanda
3621315
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: http://ideone.com/HQaKb9

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: http://ideone.com/gJ9uy7

link

answered 22 Dec '14, 21:46

rishabhprsd7's gravatar image

2★rishabhprsd7
1.9k11242
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 : http://www.codechef.com/viewsolution/5636413 here one of the top AC solutions : http://ideone.com/TT0Ay6 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
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:

×1,056
×102
×12

question asked: 22 Dec '14, 20:50

question was seen: 873 times

last updated: 22 Dec '14, 22:09