結果

問題 No.233 めぐるはめぐる (3)
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-06-27 11:23:42
言語 Python2
(2.7.18)
結果
AC  
実行時間 384 ms / 1,000 ms
コード長 594 bytes
コンパイル時間 788 ms
コンパイル使用メモリ 6,800 KB
実行使用メモリ 31,328 KB
最終ジャッジ日時 2023-09-22 03:07:10
合計ジャッジ時間 8,306 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 375 ms
28,936 KB
testcase_01 AC 315 ms
26,684 KB
testcase_02 AC 262 ms
22,148 KB
testcase_03 AC 334 ms
31,328 KB
testcase_04 AC 382 ms
28,996 KB
testcase_05 AC 381 ms
28,912 KB
testcase_06 AC 383 ms
29,068 KB
testcase_07 AC 384 ms
28,988 KB
testcase_08 AC 383 ms
28,988 KB
testcase_09 AC 204 ms
18,088 KB
testcase_10 AC 207 ms
18,092 KB
testcase_11 AC 203 ms
18,164 KB
testcase_12 AC 317 ms
26,788 KB
testcase_13 AC 376 ms
29,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import permutations, product
who = 'inabameguru'
sz = len(who)
nya = ''.join(who[i] for i in xrange(0, len(who), 2))
nyk = ''.join(who[i] for i in xrange(1, len(who), 2))
nyaa = {''.join(e) for e in permutations(nya)}
nykk = {''.join(e) for e in permutations(nyk)}
sett = set()
for ele in product(nykk, nyaa):
    x = ''.join(map(''.join, zip(ele[0], ele[1][:-1])))
    for i in xrange(sz):
        sett.add(x[:i] + ele[1][-1] + x[i:])
n = int(raw_input())
s = set(raw_input() for _ in xrange(n))
sett -= s
print (list(sett) + ['NO'])[0]
0