結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー | maine_honzuki |
提出日時 | 2021-04-26 18:47:12 |
言語 | C++17 (gcc 12.3.0 + boost 1.83.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 972 bytes |
コンパイル時間 | 2,957 ms |
コンパイル使用メモリ | 212,596 KB |
実行使用メモリ | 13,708 KB |
最終ジャッジ日時 | 2023-09-18 14:09:32 |
合計ジャッジ時間 | 11,157 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge13 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 167 ms
13,096 KB |
testcase_01 | AC | 102 ms
9,672 KB |
testcase_02 | AC | 55 ms
6,576 KB |
testcase_03 | AC | 113 ms
10,420 KB |
testcase_04 | TLE | - |
testcase_05 | AC | 598 ms
13,464 KB |
testcase_06 | AC | 567 ms
13,556 KB |
testcase_07 | TLE | - |
testcase_08 | TLE | - |
testcase_09 | AC | 22 ms
4,380 KB |
testcase_10 | AC | 22 ms
4,380 KB |
testcase_11 | AC | 22 ms
4,380 KB |
testcase_12 | AC | 104 ms
9,796 KB |
testcase_13 | AC | 166 ms
13,384 KB |
ソースコード
#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 = true; } } 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; }