結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-04-17 22:02:23 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 656 ms / 1,000 ms |
| コード長 | 2,043 bytes |
| コンパイル時間 | 2,651 ms |
| コンパイル使用メモリ | 182,232 KB |
| 実行使用メモリ | 13,568 KB |
| 最終ジャッジ日時 | 2024-12-26 11:29:53 |
| 合計ジャッジ時間 | 9,943 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
// 35/40
#include <bits/stdc++.h>
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a) a.begin(),a.end()
#define PB(a) push_back(a)
#define FS first
#define SD second
#define SEP(i,n) (i==n-1?'\n':' ')
#define PUTNUM(a,b,c) (a==b?c:a)
using namespace std;
using ll=long long;
using P=pair<int,int>;
using VI=vector<int>;
using VVI=vector<VI>;
using VVVI=vector<VVI>;
using VL=vector<ll>;
using VVL=vector<VL>;
using VVVL=vector<VVL>;
using VB=vector<bool>;
using VVB=vector<VB>;
using VP=vector<P>;
using VVP=vector<VP>;
using VS=vector<string>;
const int dx[]={0,-1,1,0},dy[]={-1,0,0,1};
//const int dx[]={-1,0,1,-1,1,-1,0,1},dy[]={-1,-1,-1,0,0,1,1,1};
template<typename T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}
template<typename T>T eucld(T a,T b){if(a<b)swap(a,b);while(a%b){T q=a%b;a=b;b=q;}return b;}
ll modpow(ll a,ll k,ll m=MOD){a%=m;if(a==0)return 0;ll r=1;while(k>0){if(k&1)r=r*a%m;a=a*a%m;k>>=1;}return r;}
struct UnionFind{VI v;UnionFind(int n):v(n){rep(i,n)v[i]=i;}int root(int x){if(v[x]==x)return x;return v[x]=root(v[x]);}void unite(int x,int y){int a=root(x),b=root(y);if(a!=b)v[a]=b;}bool same(int x,int y){return root(x)==root(y);}};
int main(void) {
cin.tie(0);
ios::sync_with_stdio(0);
cout << fixed << setprecision(7);
int n; cin >> n;
set<string> s;
rep(i,n) {
string si; cin >> si;
s.insert(si);
}
string t="inabameguru";
sort(ALL(t));
set<char> v;
v.insert('a');
v.insert('i');
v.insert('u');
v.insert('e');
do {
rep(i,t.size()-1) {
if(v.count(t[i])==0 && v.count(t[i+1])==0) goto next_loop;
}
if(!v.count(t.back())) goto next_loop;
if(!s.count(t)) {
cout << t << endl;
return 0;
}
next_loop:
NULL;
} while (next_permutation(ALL(t)));
cout << "NO" << endl;
return 0;
}