結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー |
|
提出日時 | 2017-08-31 01:57:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,094 bytes |
コンパイル時間 | 1,052 ms |
コンパイル使用メモリ | 102,232 KB |
実行使用メモリ | 13,568 KB |
最終ジャッジ日時 | 2024-11-06 14:42:41 |
合計ジャッジ時間 | 6,332 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | WA * 11 |
ソースコード
#include <algorithm> #include <cmath> #include <cstdio> #include <cstdlib> #include <functional> #include <iostream> #include <iterator> #include <list> #include <map> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <valarray> #include <vector> #define N 1000 #define M 1000000007 #define re(i,n) for(int i=0;i<(n);i++) #define rep(i,a,b) for(int i=(a);i<(b);i++) #define fe(i,n,f) for_each(i,n,f) #define bw(a,b,c) (((a)<=(b))&&((b)<=(c))) using namespace std; typedef long long ll; typedef unsigned long long ull; string a="iaaeuu"; string b="nbmgr"; bool fa[6]={0}; bool fb[5]={0}; int n; set<string> l; int main(void){ string s; cin>>n; re(i,n)cin>>s,l.insert(s); sort(a.begin(),a.end()); sort(b.begin(),b.end()); do{ do{ s=""; re(i,5){ s+=b[i]; s+=a[i]; } re(i,11){ s=s.substr(0,i)+a[5]+s.substr(i); if(l.find(s)==l.end())return cout<<s<<endl,0; } }while(next_permutation(b.begin(),b.end())); }while(next_permutation(a.begin(),a.end())); cout<<"NO"<<endl; return 0; }