I'm not sure about your code in particular, but here are some cases I'd check manually: C=1 R=1 Then try various values of K for R=C=5. Like 0-7 and 18-25. Just look at all of those.
Good luck! Bartholomew On Mon, Feb 17, 2020 at 8:41 AM sher <[email protected]> wrote: > I have been at this for hours, and I can't find out why it's giving me WA! > I checked with other accepted answers and the basic logic is the same. > What's could the problem be? > > ```python3 > #!/usr/bin/env python3 > # -*- coding: utf-8 -*- > """ > Created on Sat Feb 15 09:34:13 2020 > > @author: shreya > """ > > T = int(input()) > > for t in range(1, T+1): > R, C, K = map(int, input().split()) > openDoors = [] > > if K == (R*C)-1: > print("Case #{}: IMPOSSIBLE".format(t)) > continue > if C == 1: > openDoors = ['N']*K + ['S'] + ['N']*(R-K-1) > print("Case #{}: POSSIBLE\n{}".format(t, '\n'.join(openDoors))) > continue > > openRow = ['N']*C > closedRow = ['E'] + ['W']*(C-1) > > openDoors = [openRow]*(K//C) > > if not K%C: # divisible > openDoors.extend([closedRow]*(R-(K//C))) > else: > row = ['N']*(K%C) + ['E'] + ['W']*(C-(K%C)-1) > if C-(K%C)-1 == 0: > row[-1] = 'S' > openDoors.append(row) > openDoors.extend([closedRow]*(R-(K//C)-1)) > > for i in range(0, R): > openDoors[i] = ''.join(openDoors[i]) > print("Case #{}: POSSIBLE\n{}".format(t, '\n'.join(openDoors))) > > ``` > > -- > You received this message because you are subscribed to the Google Groups > "Google Code Jam" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/google-code/736af48e-000d-456f-94c4-24e596232695%40googlegroups.com > <https://groups.google.com/d/msgid/google-code/736af48e-000d-456f-94c4-24e596232695%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Google Code Jam" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/google-code/CAHaiWHMr59v5pZwYm46ezTNB5Ha9dM0b1Sb9a_fLjGMqfB8QFQ%40mail.gmail.com.
