結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
beet
|
| 提出日時 | 2018-11-15 17:34:37 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 800 bytes |
| コンパイル時間 | 2,379 ms |
| コンパイル使用メモリ | 202,924 KB |
| 最終ジャッジ日時 | 2025-01-06 16:42:30 |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 TLE * 3 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
//INSERT ABOVE HERE
signed main(){
int n;
cin>>n;
set<string> ss;
for(int i=0;i<n;i++){
string s;
cin>>s;
ss.emplace(s);
}
string b="inabameguru";
sort(b.begin(),b.end());
auto is_b=[](char c){return c=='a'||c=='i'||c=='u'||c=='e'||c=='o';};
do{
if(ss.count(b)) continue;
if(!is_b(b.back())) continue;
int flg=0;
for(int i=0;i+1<(int)b.size();i++)
flg|=!is_b(b[i])&&!is_b(b[i+1]);
if(flg) continue;
cout<<b<<endl;
return 0;
}while(next_permutation(b.begin(),b.end()));
cout<<"NO"<<endl;
return 0;
}
beet