WA in SEACO(Sept 17)

I am Getting WA in SEACO From Sept Long Challenge 2017

Need TESTCASE for which my code is Failing.

Link to Problem : CodeChef: Practical coding for everyone

Link to solution : CodeChef: Practical coding for everyone

Modular subtraction does not work the same way as modular addition. Try this function below instead. That is how i did it.

long long sub(long long a, long long b) {
    return (a % mod - b % mod + mod) % mod;
}
2 Likes

Yeah !!
It Worked .
Thanks!!

1 Like