結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-06-02 22:56:21 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 705 bytes |
| コンパイル時間 | 475 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 25,844 KB |
| 最終ジャッジ日時 | 2024-11-24 15:53:10 |
| 合計ジャッジ時間 | 28,696 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 1 TLE * 2 |
| other | TLE * 11 |
ソースコード
import itertools
N = int(input())
S = set(input().split())
anagrams = set()
def make_str(consonant, vowel, dup):
lst = [''] * 11
dup_flag = True
for i in range(11):
if dup * 2 <= i:
dup_flag = False
if dup_flag ^ (i % 2):
lst[i] = next(consonant)
else:
lst[i] = next(vowel)
return ''.join(map(str, lst))
for consonant in itertools.permutations(('n', 'b', 'm', 'g', 'r')):
for vowel in itertools.permutations(('i', 'a', 'a', 'e', 'u', 'u')):
for dup in range(5):
anagrams.add(make_str(iter(consonant), iter(vowel), dup))
if N == len(anagrams):
print('NO')
else:
print((anagrams - S).pop())