結果

問題 No.233 めぐるはめぐる (3)
ユーザー ctyl_0ctyl_0
提出日時 2015-09-15 04:50:23
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 183 ms / 1,000 ms
コード長 1,847 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 95,760 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2023-09-26 12:01:54
合計ジャッジ時間 5,049 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 131 ms
13,008 KB
testcase_01 AC 72 ms
9,580 KB
testcase_02 AC 32 ms
6,508 KB
testcase_03 AC 85 ms
10,492 KB
testcase_04 AC 180 ms
13,496 KB
testcase_05 AC 145 ms
13,568 KB
testcase_06 AC 143 ms
13,480 KB
testcase_07 AC 176 ms
13,460 KB
testcase_08 AC 183 ms
13,444 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,380 KB
testcase_12 AC 75 ms
9,704 KB
testcase_13 AC 134 ms
13,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

#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);
    set<string> str;
    rep(i, N){
        //cin >> str[i];
        string sss;
        cin >> sss;
        str.insert(sss);
    }
    
    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;
//            }
            if (str.count(m) == 0) {
                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