結果
| 問題 | 
                            No.233 めぐるはめぐる (3)
                             | 
                    
| コンテスト | |
| ユーザー | 
                             沙耶花
                         | 
                    
| 提出日時 | 2021-11-18 20:02:34 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 744 bytes | 
| コンパイル時間 | 4,621 ms | 
| コンパイル使用メモリ | 258,648 KB | 
| 最終ジャッジ日時 | 2025-01-25 19:20:57 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge5 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | WA * 3 | 
| other | WA * 11 | 
ソースコード
#include <stdio.h>
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
using mint = modint1000000007;
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define Inf 1000000001
int main(){
	
	string bo = "iaaeuu";
	string si = "nbmgr";
	
	sort(bo.begin(),bo.end());
	sort(si.begin(),si.end());
	
	int n;
	cin>>n;
	
	set<string> s;
	rep(i,n){
		string t;
		cin>>t;
		s.insert(t);
	}
	
	do{
		sort(si.begin(),si.end());
		do{
			string t = "";
			rep(i,4){
				t += bo[i];
				t += si[i];
			}
			t += bo.back();
			if(!s.count(t)){
				cout<<t<<endl;
				return 0;
			}
		}
		while(next_permutation(si.begin(),si.end()));
	}while(next_permutation(bo.begin(),bo.end()));
	
	cout<<"NO"<<endl;
	
	return 0;
}
            
            
            
        
            
沙耶花