結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー |
|
提出日時 | 2020-06-02 23:09:09 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 666 bytes |
コンパイル時間 | 133 ms |
コンパイル使用メモリ | 82,624 KB |
実行使用メモリ | 100,260 KB |
最終ジャッジ日時 | 2024-11-24 16:16:49 |
合計ジャッジ時間 | 7,663 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 305 ms
99,560 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 301 ms
90,856 KB |
testcase_08 | AC | 281 ms
90,844 KB |
testcase_09 | AC | 323 ms
99,496 KB |
testcase_10 | AC | 311 ms
99,640 KB |
testcase_11 | RE | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
ソースコード
import itertools N = int(input()) S = set(input().split()) anagrams = set() def make_str(consonant, vowel, dup): s = '' dup_flag = True for i in range(11): if dup * 2 <= i: dup_flag = False if dup_flag ^ (i % 2): s += next(consonant) else: s += next(vowel) return s for consonant in itertools.permutations(('n', 'b', 'm', 'g', 'r')): for vowel in itertools.permutations(('i', 'a', 'a', 'e', 'u', 'u')): for dup in range(6): anagrams.add(make_str(iter(consonant), iter(vowel), dup)) if N == len(anagrams): print('NO') else: print((anagrams - S).pop())