結果
| 問題 | No.233 めぐるはめぐる (3) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2015-06-27 00:03:56 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 143 ms / 1,000 ms | 
| コード長 | 825 bytes | 
| コンパイル時間 | 1,279 ms | 
| コンパイル使用メモリ | 169,200 KB | 
| 実行使用メモリ | 13,568 KB | 
| 最終ジャッジ日時 | 2024-07-07 19:26:48 | 
| 合計ジャッジ時間 | 4,180 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n)           for(int(i)=0;(i)<(n);++(i))
#define EACH(it, c)         for(auto it=(c).begin();it!=(c).end();++it)
int main(){
    int N;
    cin >> N;
    set<string> S;
    REP(i,N){
        string s; cin >> s;
        S.insert(s);
    }
    string s0 = "nbmgr*";
    string s1 = "iaaeuu";
    sort(s0.begin(), s0.end());
    sort(s1.begin(), s1.end());
    do {
        do {
            string k;
            REP(i,6){
                if(s0[i] != '*') k += s0[i];
                k += s1[i];
            }
            if(S.count(k)) continue;
            cout << k << endl;
            return 0;
          
        } while(next_permutation(s1.begin(), s1.end()));
    } while(next_permutation(s0.begin(), s0.end()));
    cout << "NO" << endl;
    return 0;
}
            
            
            
        