結果

問題 No.233 めぐるはめぐる (3)
ユーザー teruneterune
提出日時 2016-08-26 00:05:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 655 ms / 1,000 ms
コード長 519 bytes
コンパイル時間 120 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 39,548 KB
最終ジャッジ日時 2024-04-25 16:58:57
合計ジャッジ時間 10,869 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 647 ms
38,680 KB
testcase_01 AC 541 ms
39,072 KB
testcase_02 AC 449 ms
28,612 KB
testcase_03 AC 575 ms
39,548 KB
testcase_04 AC 643 ms
39,004 KB
testcase_05 AC 652 ms
38,992 KB
testcase_06 AC 649 ms
39,004 KB
testcase_07 AC 643 ms
39,156 KB
testcase_08 AC 655 ms
39,144 KB
testcase_09 AC 382 ms
23,120 KB
testcase_10 AC 362 ms
23,124 KB
testcase_11 AC 371 ms
23,124 KB
testcase_12 AC 547 ms
39,116 KB
testcase_13 AC 629 ms
38,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations
N = int(input())
a = [input() for i in range(N)]
vow = ["i","a","a","e","u","u"]
con = [" ","n","b","m","g","r"]
vow_all = set( permutations(vow))
con_all = set( permutations(con))

all_list = set()
for v in vow_all:
    for c in con_all:
        strings = ''
        for k in range(6):
            strings = strings + c[k] + v[k]
        all_list.add( strings.replace(' ','') )

a = set(a)
all_list -= a

if len(all_list) == 0:
    print('NO')
else:
    print('%s' % all_list.pop())
0