結果
問題 |
No.233 めぐるはめぐる (3)
|
ユーザー |
![]() |
提出日時 | 2015-07-25 19:06:19 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 896 bytes |
コンパイル時間 | 649 ms |
コンパイル使用メモリ | 89,628 KB |
実行使用メモリ | 7,360 KB |
最終ジャッジ日時 | 2024-07-08 13:49:31 |
合計ジャッジ時間 | 4,917 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 11 |
ソースコード
#include<sstream> #include<iostream> #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<string> #include<vector> #include<set> #include<map> #include<queue> #include<numeric> #include<functional> #include<algorithm> #include<bitset> #include<cctype> using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) #define indexOf(v,x) (find(all(v),x)-v.begin()) int main(){ string str("inabameguru"); int n; cin>>n; vector<string> s(n); rep(i,n)cin>>s[i]; sort(all(str)); do{ bool ok=true; rep(i,str.size()-1){ if(isupper(str[i])&&isupper(str[i+1]))ok=false; } if(isupper(str[str.size()-1]))ok=false; if(ok&&!binary_search(all(s),str)){ cout<<str<<endl; return 0; } }while(next_permutation(all(str))); cout<<"NO"<<endl; return 0; }