結果

問題 No.233 めぐるはめぐる (3)
コンテスト
ユーザー kimiyuki
提出日時 2016-01-14 18:00:05
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 930 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 558 ms
コンパイル使用メモリ 104,104 KB
実行使用メモリ 12,792 KB
最終ジャッジ日時 2026-11-01 17:50:28
合計ジャッジ時間 4,665 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 12 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <vector>
#include <algorithm>
#include <unordered_set>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
using namespace std;
int main() {
    int n; cin >> n;
    unordered_set<string> s;
    repeat (i,n) {
        string t; cin >> t;
        s.insert(t);
    }
    string vowels = "aaeiuu";
    do {
        string consonants = "bgmnr";
        do {
            repeat (i, 5) {
                string t;
                repeat (j, 5) {
                    if (i == j) t += vowels[5];
                    t += consonants[j];
                    t += vowels[j];
                }
                if (not s.count(t)) {
                    cout << t << endl;
                    return 0;
                }
            }
        } while (next_permutation(consonants.begin(), consonants.end()));
    } while (next_permutation(vowels.begin(), vowels.end()));
    cout << "NO" << endl;
    return 0;
}
0