結果

問題 No.233 めぐるはめぐる (3)
ユーザー pekempeypekempey
提出日時 2015-06-26 23:38:49
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 994 bytes
コンパイル時間 1,554 ms
コンパイル使用メモリ 152,656 KB
実行使用メモリ 13,608 KB
最終ジャッジ日時 2023-09-22 01:44:40
合計ジャッジ時間 6,256 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 114 ms
12,992 KB
testcase_01 AC 67 ms
9,800 KB
testcase_02 AC 31 ms
6,368 KB
testcase_03 AC 76 ms
10,316 KB
testcase_04 AC 220 ms
13,608 KB
testcase_05 AC 181 ms
13,456 KB
testcase_06 AC 169 ms
13,560 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 68 ms
9,608 KB
testcase_13 AC 117 ms
13,540 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--)
#define all(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;

int main() {
    string a = "nbmgr~";
    string b = "iaaeuu";

    int A[6], B[6];

    rep (i, 6) A[i] = i;
    rep (i, 6) B[i] = i;

    set<string> s;

    int n;
    cin >> n;
    rep (i, n) {
        string w;
        cin >> w;
        s.insert(w);
    }
    
    do {
        do {
            string w;

            rep (i, 6) {
                if (a[A[i]] != '~') w += a[A[i]];
                w += b[B[i]];
            }

            if (!s.count(w)) {
                cout << w << endl;
                return 0;
            }
        } while (next_permutation(B, B + 6));
    } while (next_permutation(A, A + 6));
}
0