結果

問題 No.233 めぐるはめぐる (3)
ユーザー pekempeypekempey
提出日時 2015-06-28 22:38:04
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 983 bytes
コンパイル時間 1,431 ms
コンパイル使用メモリ 155,784 KB
実行使用メモリ 13,772 KB
最終ジャッジ日時 2023-09-22 04:06:34
合計ジャッジ時間 7,907 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (a) - 1; i >= (b); i--)
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    set<string> s;
    rep (i, N) {
        string temp;
        cin >> temp;
        s.insert(temp);
    }

    string a = "nbmgr~";
    string b = "iaaeuu";
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    do {
        do {
            string w;
            rep (i, 6) {
                if (a[i] != '~') w += a[i];
                w += b[i];
            }
            if (s.count(w)) {
                cout << w << endl;
                return 0;
            }
        } while (next_permutation(b.begin(), b.end()));
    } while (next_permutation(a.begin(), a.end()));

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