結果

問題 No.233 めぐるはめぐる (3)
ユーザー maine_honzukimaine_honzuki
提出日時 2021-04-26 18:46:30
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 973 bytes
コンパイル時間 3,972 ms
コンパイル使用メモリ 212,900 KB
実行使用メモリ 13,784 KB
最終ジャッジ日時 2023-09-18 14:08:42
合計ジャッジ時間 10,037 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
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>
using namespace std;

int main() {
    int N;
    cin >> N;
    set<string> used;
    for (int i = 0; i < N; i++) {
        string s;
        cin >> s;
        used.insert(s);
    }
    string sabbat_of_the_witch = "inabameguru";
    sort(sabbat_of_the_witch.begin(), sabbat_of_the_witch.end());
    set<char> boin({'a', 'i', 'u', 'e', 'o'});
    do {
        bool flag = true, shiin = false;
        for (auto&& c : sabbat_of_the_witch) {
            if (boin.count(c)) {
                shiin = false;
            } else {
                if (shiin == true)
                    flag = false;
                shiin = false;
            }
        }
        if (flag && boin.count(sabbat_of_the_witch.back()) && used.count(sabbat_of_the_witch) == 0) {
            cout << sabbat_of_the_witch << endl;
            return 0;
        }
    } while (next_permutation(sabbat_of_the_witch.begin(), sabbat_of_the_witch.end()));
    cout << "NO" << endl;
}
0