結果

問題 No.233 めぐるはめぐる (3)
ユーザー uenokuuenoku
提出日時 2016-12-02 01:16:46
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,135 bytes
コンパイル時間 823 ms
コンパイル使用メモリ 91,740 KB
実行使用メモリ 13,568 KB
最終ジャッジ日時 2024-05-05 17:20:58
合計ジャッジ時間 4,258 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
13,056 KB
testcase_01 AC 61 ms
9,472 KB
testcase_02 AC 29 ms
6,528 KB
testcase_03 AC 68 ms
10,368 KB
testcase_04 AC 160 ms
13,440 KB
testcase_05 AC 129 ms
13,440 KB
testcase_06 AC 117 ms
13,440 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 1 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 62 ms
9,728 KB
testcase_13 AC 104 ms
13,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long long int lli;
typedef pair<lli, lli> P;
lli MOD = 1000000007;
int main()
{
    char mt[6] = {'i', 'a', 'a', 'e', 'u', 'u'};
    char pa[5] = {'m', 'g', 'r', 'n', 'b'};

    sort(mt, mt + 6);
    sort(pa, pa + 5);
    set<string> s;
    int n;
    cin >> n;
    string t;
    rep(i, n)
    {
        cin >> t;
        s.insert(t);
    }
    do {
        do {
            string tmp = "..........";
            rep(i, 5) tmp[2 * i + 1] = mt[i];
            rep(i, 5) tmp[2 * i] = pa[i];
            rep(i, 10)
            {
                string a = tmp;
                string b{mt[5]};
                a.insert(i, b);
                if (s.find(a) == s.end()) {
                    cout << a << endl;
                    return 0;
                }
            }
        } while (next_permutation(pa, pa + 5));
    } while (next_permutation(mt, mt + 6));
}
0