結果

問題 No.233 めぐるはめぐる (3)
ユーザー ikdikd
提出日時 2016-07-23 10:55:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 786 bytes
コンパイル時間 752 ms
コンパイル使用メモリ 74,824 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2024-04-24 07:30:26
合計ジャッジ時間 5,579 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<string>
#include<map>
#include<algorithm>

using namespace std;

int main(){

    int N;
    cin>> N;
    map<string, int> mp;
    for(int i=0; i<N; i++){
        string S;
        cin>> S;
        mp[S]++;
    }

    string si="bgmnr", bo="aaeiuu";
    do{
        do{
            string s;
            for(int i=0; i<5; i++){
                s=s+si[i]+bo[i];
            }
            for(int i=0; i<11; i++){
                s=s.substr(0, i)+bo.back()+s.substr(i);
                if(mp.find(s)==mp.end()){
                    cout<< s<< endl;
                    return 0;
                }
            }
        }while(next_permutation(si.begin(), si.end()));
    }while(next_permutation(bo.begin(), bo.end()));

    cout<< "NO"<< endl;
    return 0;
}
0