SPECIES - Editorial

You aren’t calling your check function recursively, due to which I think it gave WA for subtask 1. If you modify your check function, and call things recursively when assigning values, it should fix the issue. Luckily no such test case might be present in subtask 2 and 3, hence you survived them. :stuck_out_tongue:

Eg:

.?.
.?.
.B.

Check my comment on @ps_1234’s answer. Yours will also fail on it.

2 Likes

so dumb of me!!
thanks

This does not pass for the 2 and 3 subtasks! What can be the problem?
Please see this :slight_smile:

So, I bruteforced your solution with one AC solution (100 points) for all possible input of 3x3 and 2x2. It gave same results.

Hence, possible problem could surely be due to your while(t–), and it turned out my fluke was right, and upon initializing arr with 0 in your exact code, lead to AC. :stuck_out_tongue:

https://www.codechef.com/viewsolution/13166042

1 Like

yes this worked, but i still didn’t get what the problem really is, when I am considering n in all of the functions and the code is checking in that n x n matrix only O_O

You might have crossed nxn while checking for surrounding points i.e. all 4 directions or something similar.

1 Like

Why do you think so? And remember about multiple test cases (T ≤ 50).

1 Like

Just to increase the feels, the SCHEDULE problem for this march long was like…well…we had an editorial of it right under our nose at the discussion forum XD

please see this!

@pkacprzak

@tni_md you cause overflow on subtasks 2 and 3. Change the type of ans variable from int to long long and you’ll get accepted CodeChef: Practical coding for everyone

Okay thanks :slight_smile:

For me it was this case

2

G?

Answer is 0 but my code was giving 1 as output.

I am also facing this problem.
Please help me for this .this is my solution
https://www.codechef.com/viewsolution/27268290

In the sample test case
7
?.?.?.?
.?.?.?.
?.?.?.?
.?.?.?.
?.?.?.?
.?.?.?.
?.?.?.?
why isn’t the answer 3^25?

as 3^25 is a big number so we have taken its mod with 1e9+7. :slight_smile: