WA on Matrix Again[Closed]

Here is my code: CodeChef: Practical coding for everyone
getting wrong answer,tried almost all test cases.
Can’t figure out the mistake!
I bet its something very minute. :frowning:

Simplify the column sum to:

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

and simplify the column-sum product to:

product = (product * sum) % 10000007;

Hey bro

Your code gives WA for this test case: HQaKb9 - Online C++ Compiler & Debugging Tool - Ideone.com

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: gJ9uy7 - Online C++ Compiler & Debugging Tool - Ideone.com

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

Two things!

  1. I got AC,I wrote the loops in the reverse order :stuck_out_tongue:
  2. That AC code gives WA for the input you provided.
    The correct answer is 7901228.
    Here is my AC solution :
    CodeChef: Practical coding for everyone
    here one of the top AC solutions :
    TT0Ay6 - Online C++ Compiler & Debugging Tool - Ideone.com
    both give the same answer :slight_smile:
    I don’t know how that solution got AC with wrong answer on that test case!!

okay sorry for that, i didn’t knew about that it AC code is giving WA…

SOrry… :frowning: