結果

問題 No.233 めぐるはめぐる (3)
ユーザー ctyl_0ctyl_0
提出日時 2015-09-15 04:47:17
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,625 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 85,256 KB
実行使用メモリ 89,640 KB
最終ジャッジ日時 2023-09-26 12:01:49
合計ジャッジ時間 4,601 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 47 ms
13,976 KB
testcase_01 AC 28 ms
5,816 KB
testcase_02 AC 15 ms
4,504 KB
testcase_03 AC 30 ms
6,080 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;


int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
    int N = inputValue();
    vector<string> str(N);
    rep(i, N){
        cin >> str[i];
    }
    
    string b, s;
    s = "xnbmgr";
    b = "iaaeuu";
    
    sort(b.begin(), b.end());
    sort(s.begin(), s.end());
    
    do{
        do{
            string m;
            rep(i, 6){
                if (s[i] != 'x') {
                    m.push_back(s[i]);
                }
                
                m.push_back(b[i]);
                
            }
            auto it = find(str.begin(), str.end(), m);
            if (it == str.end()) {
                output(m, 0);
                return 0;
            }
            
        } while(next_permutation(b.begin(), b.end()));
        
    }while(next_permutation(s.begin(), s.end()));
    
    output("NO", 0);
    
    
    return 0;
}
0