結果

問題 No.233 めぐるはめぐる (3)
ユーザー yuppe19 😺yuppe19 😺
提出日時 2016-03-02 22:34:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 270 ms / 1,000 ms
コード長 465 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 81,624 KB
実行使用メモリ 94,876 KB
最終ジャッジ日時 2023-10-24 19:36:05
合計ジャッジ時間 5,722 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 263 ms
94,872 KB
testcase_01 AC 228 ms
91,536 KB
testcase_02 AC 192 ms
87,904 KB
testcase_03 AC 234 ms
92,252 KB
testcase_04 AC 270 ms
94,872 KB
testcase_05 AC 267 ms
94,872 KB
testcase_06 AC 267 ms
94,872 KB
testcase_07 AC 265 ms
94,872 KB
testcase_08 AC 270 ms
94,876 KB
testcase_09 AC 140 ms
85,584 KB
testcase_10 AC 141 ms
85,584 KB
testcase_11 AC 138 ms
85,584 KB
testcase_12 AC 229 ms
92,252 KB
testcase_13 AC 268 ms
94,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python3
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 range(m):
        sett.add(x[:i] + q[-1] + x[i:])
n = int(input())
s = set(input() for _ in range(n))
sett -= s
res = 'NO'
if len(sett):
    res = sett.pop()
print(res)
0