結果
| 問題 | No.233 めぐるはめぐる (3) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-27 11:23:42 |
| 言語 | PyPy2 (7.3.20) |
| 結果 |
AC
|
| 実行時間 | 303 ms / 1,000 ms |
| コード長 | 594 bytes |
| 記録 | |
| コンパイル時間 | 137 ms |
| コンパイル使用メモリ | 77,840 KB |
| 最終ジャッジ日時 | 2025-12-03 15:44:30 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
#!/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]