結果
| 問題 | No.233 めぐるはめぐる (3) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-04-28 14:11:21 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
AC
|
| 実行時間 | 251 ms / 1,000 ms |
| コード長 | 616 bytes |
| 記録 | |
| コンパイル時間 | 2,007 ms |
| コンパイル使用メモリ | 225,920 KB |
| 実行使用メモリ | 22,016 KB |
| 最終ジャッジ日時 | 2026-04-28 14:11:30 |
| 合計ジャッジ時間 | 8,031 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
module main;
// https://yukicoder.me/problems/no/233/editorial より
// 全探索
import std;
void main()
{
// 入力
int N = readln.chomp.to!int;
auto S = redBlackTree!string();
foreach (_; 0 .. N)
S.insert(readln.chomp);
// 答えの計算と出力
auto consonant = ["", "n", "b", "m", "g", "r"].sort;
auto vowel = ["i", "a", "a", "e", "u", "u"].sort;
do {
do {
string name;
foreach (c, v; lockstep(consonant, vowel)) {
name ~= c ~ v;
}
if (name !in S) {
writeln(name);
return;
}
} while (nextPermutation(vowel));
} while (nextPermutation(consonant));
writeln("NO");
}