結果

問題 No.233 めぐるはめぐる (3)
ユーザー pekempeypekempey
提出日時 2015-06-28 22:38:36
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 202 ms / 1,000 ms
コード長 984 bytes
コンパイル時間 1,386 ms
コンパイル使用メモリ 155,692 KB
実行使用メモリ 13,540 KB
最終ジャッジ日時 2023-09-22 04:08:00
合計ジャッジ時間 5,662 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 149 ms
13,068 KB
testcase_01 AC 85 ms
9,864 KB
testcase_02 AC 36 ms
6,476 KB
testcase_03 AC 95 ms
10,328 KB
testcase_04 AC 199 ms
13,524 KB
testcase_05 AC 169 ms
13,464 KB
testcase_06 AC 165 ms
13,540 KB
testcase_07 AC 195 ms
13,464 KB
testcase_08 AC 202 ms
13,536 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 85 ms
9,784 KB
testcase_13 AC 155 ms
13,304 KB
権限があれば一括ダウンロードができます

ソースコード

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