Hello,

Can anybody give me a hint why this Python 3 solution to 2019 1C Power 
Arrangers passes the testing tool (the 1st test case), but gives WA in real 
judge?


 from itertools import permutations

def main():
    T, F = map(int, input().split())  # the number of test cases and the 
number of figures allowed to inspect
    arrangers = {'A', 'B', 'C', 'D', 'E'}

    for _ in range(T):
        candidates = set(permutations(arrangers))
        letters = []

        for figure in range(1, 594):
            if figure % 5 == 0:
                letters.extend(arrangers.difference(letters))
                candidates.remove(tuple(letters))
                letters = []
            else:
                print(figure, flush=True)
                letter = input()

                if letter == 'N':
                    return
                letters.append(letter)

        for c in candidates:
            if not ''.join(c).startswith(''.join(letters)):
                print(''.join(c), flush=True)
                result = input()
                if result == 'N':
                    return
                break


main()

-- 
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/640cdd6e-2c8f-4436-9a49-a0c4827535fe%40googlegroups.com.

Reply via email to