結果

問題 No.233 めぐるはめぐる (3)
ユーザー yuppe19 😺yuppe19 😺
提出日時 2016-03-02 22:29:05
言語 Python2
(2.7.18)
結果
AC  
実行時間 370 ms / 1,000 ms
コード長 475 bytes
コンパイル時間 382 ms
コンパイル使用メモリ 7,104 KB
実行使用メモリ 31,988 KB
最終ジャッジ日時 2023-10-24 19:35:25
合計ジャッジ時間 7,032 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 362 ms
29,572 KB
testcase_01 AC 303 ms
27,320 KB
testcase_02 AC 242 ms
21,376 KB
testcase_03 AC 317 ms
31,988 KB
testcase_04 AC 370 ms
29,572 KB
testcase_05 AC 369 ms
29,572 KB
testcase_06 AC 370 ms
29,572 KB
testcase_07 AC 369 ms
29,572 KB
testcase_08 AC 367 ms
29,572 KB
testcase_09 AC 181 ms
16,628 KB
testcase_10 AC 181 ms
16,628 KB
testcase_11 AC 183 ms
16,628 KB
testcase_12 AC 307 ms
27,312 KB
testcase_13 AC 368 ms
29,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python2
from itertools import permutations, product
who = 'inabameguru'
m = len(who)
vow = set(map(''.join, permutations(who[::2])))
con = set(map(''.join, permutations(who[1::2])))
sett = set()
for p, q in product(con, vow):
    x = ''.join(map(''.join, zip(p, q[:-1])))
    for i in xrange(m):
        sett.add(x[:i] + q[-1] + x[i:])
n = int(raw_input())
s = set(raw_input() for _ in xrange(n))
sett -= s
res = 'NO'
if len(sett):
    res = sett.pop()
print(res)
0