結果
| 問題 | No.233 めぐるはめぐる (3) |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-11-05 03:55:59 |
| 言語 | PyPy3 (8.0.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 238 ms / 1,000 ms |
| + 869µs | |
| コード長 | 675 bytes |
| 記録 | |
| コンパイル時間 | 94 ms |
| コンパイル使用メモリ | 64,488 KB |
| 実行使用メモリ | 75,020 KB |
| 最終ジャッジ日時 | 2026-11-05 03:56:05 |
| 合計ジャッジ時間 | 5,799 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 |
ソースコード
from itertools import permutations
consonants = 'nbmgr'
vowels = 'iaaeuu'
N = int(input())
SS = [input() for _ in range(N)]
def solve():
used = set(SS)
for a in permutations(consonants):
for b in permutations(vowels):
xs = []
for i in range(5):
xs.append(a[i])
xs.append(b[i])
last = b[-1]
for i in range(6):
ys = xs.copy()
ys.insert(i * 2, last)
t = ''.join(ys)
if t not in used:
print(t)
return True
return False
found = solve()
if not found:
print('NO')
norioc