結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
maine_honzuki
|
| 提出日時 | 2021-04-26 18:48:50 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 992 bytes |
| コンパイル時間 | 4,258 ms |
| コンパイル使用メモリ | 209,504 KB |
| 最終ジャッジ日時 | 2025-01-21 01:12:30 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 TLE * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int N;
cin >> N;
unordered_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());
unordered_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;
}
maine_honzuki