結果

問題 No.233 めぐるはめぐる (3)
ユーザー htkbhtkb
提出日時 2018-05-01 11:40:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 829 ms / 1,000 ms
コード長 462 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 10,936 KB
実行使用メモリ 31,472 KB
最終ジャッジ日時 2023-09-10 08:38:06
合計ジャッジ時間 14,172 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 810 ms
30,228 KB
testcase_01 AC 730 ms
30,708 KB
testcase_02 AC 657 ms
23,424 KB
testcase_03 AC 733 ms
31,472 KB
testcase_04 AC 822 ms
30,416 KB
testcase_05 AC 808 ms
30,456 KB
testcase_06 AC 809 ms
30,464 KB
testcase_07 AC 829 ms
30,408 KB
testcase_08 AC 822 ms
30,424 KB
testcase_09 AC 584 ms
20,216 KB
testcase_10 AC 571 ms
20,124 KB
testcase_11 AC 588 ms
20,232 KB
testcase_12 AC 723 ms
30,892 KB
testcase_13 AC 798 ms
30,304 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
name = set()
add, diff = name.add, name.difference_update
consonant = ["", "n", "b", "m", "g", "r"]
vowel = ["i", "a", "a", "e", "u", "u"]
for a, c, e, g, i, k in permutations(consonant):
    for b, d, f, h, j, l in permutations(vowel):
        add(a+b+c+d+e+f+g+h+i+j+k+l)

n = int(input())
name2 = []
append = name2.append
for _ in [0]*n:
    append(input())

name.difference_update(name2)
print(name.pop() if name else "NO")
0