結果

問題 No.233 めぐるはめぐる (3)
ユーザー tnoda_tnoda_
提出日時 2015-09-14 19:37:45
言語 Python2
(2.7.18)
結果
AC  
実行時間 732 ms / 1,000 ms
コード長 487 bytes
コンパイル時間 64 ms
コンパイル使用メモリ 6,536 KB
実行使用メモリ 16,288 KB
最終ジャッジ日時 2023-09-26 11:50:16
合計ジャッジ時間 7,641 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 184 ms
16,288 KB
testcase_01 AC 118 ms
11,920 KB
testcase_02 AC 65 ms
10,136 KB
testcase_03 AC 136 ms
16,148 KB
testcase_04 AC 639 ms
16,156 KB
testcase_05 AC 615 ms
16,148 KB
testcase_06 AC 514 ms
16,216 KB
testcase_07 AC 729 ms
16,232 KB
testcase_08 AC 732 ms
16,236 KB
testcase_09 AC 12 ms
6,108 KB
testcase_10 AC 12 ms
6,068 KB
testcase_11 AC 11 ms
6,068 KB
testcase_12 AC 120 ms
11,740 KB
testcase_13 AC 189 ms
16,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from itertools import permutations

N = input()
S = set([])
for i in xrange(N):
    S.add(raw_input())

# inabameguru
cons = list("nbmgr")
vow = list("iaaeuu")
for cs in permutations(cons):
    for vs in permutations(vow):
        base = ""
        for i in xrange(len(cs)):
            base += cs[i] + vs[i]
        for i in xrange(len(base)+1):
            name = base[:i] + vs[5] + base[i:]
            if name not in S:
                print(name)
                quit()
print('NO')
0