結果

問題 No.233 めぐるはめぐる (3)
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-06-27 11:11:59
言語 Python2
(2.7.18)
結果
AC  
実行時間 367 ms / 1,000 ms
コード長 633 bytes
コンパイル時間 53 ms
コンパイル使用メモリ 6,672 KB
実行使用メモリ 31,416 KB
最終ジャッジ日時 2023-09-22 03:06:48
合計ジャッジ時間 7,025 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 358 ms
29,112 KB
testcase_01 AC 306 ms
26,788 KB
testcase_02 AC 255 ms
22,032 KB
testcase_03 AC 323 ms
31,416 KB
testcase_04 AC 364 ms
29,020 KB
testcase_05 AC 366 ms
29,096 KB
testcase_06 AC 367 ms
28,912 KB
testcase_07 AC 362 ms
28,904 KB
testcase_08 AC 363 ms
29,044 KB
testcase_09 AC 205 ms
18,120 KB
testcase_10 AC 204 ms
18,120 KB
testcase_11 AC 206 ms
18,124 KB
testcase_12 AC 311 ms
26,740 KB
testcase_13 AC 363 ms
28,936 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import permutations, product, izip_longest
who = 'inabameguru'
n = 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(lambda e: ''.join(e), zip(ele[0], ele[1][:-1])))
    for i in xrange(n):
        y = x[:i] + ele[1][-1] + x[i:]
        sett.add(y)
n = int(raw_input())
s = set(raw_input() for _ in xrange(n))
sett -= s
print (list(sett) + ['NO'])[0]
0