結果

問題 No.233 めぐるはめぐる (3)
ユーザー HAHAHAHAHAHA
提出日時 2015-06-30 14:49:52
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 251 ms / 1,000 ms
コード長 1,240 bytes
コンパイル時間 1,379 ms
コンパイル使用メモリ 90,452 KB
実行使用メモリ 13,556 KB
最終ジャッジ日時 2023-09-22 04:42:01
合計ジャッジ時間 5,639 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 173 ms
13,080 KB
testcase_01 AC 95 ms
9,740 KB
testcase_02 AC 43 ms
6,476 KB
testcase_03 AC 112 ms
10,328 KB
testcase_04 AC 227 ms
13,500 KB
testcase_05 AC 203 ms
13,556 KB
testcase_06 AC 189 ms
13,492 KB
testcase_07 AC 251 ms
13,464 KB
testcase_08 AC 248 ms
13,508 KB
testcase_09 AC 2 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 89 ms
9,748 KB
testcase_13 AC 155 ms
13,312 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<utility>
#include <fstream>
#include<set>
#include<map>
#include<cctype>
#include<cmath>
#include<algorithm>
using namespace std;


#define RALL(x) (x).rbegin(),(x).rend()
#define ALL(x) (x).begin(),(x).end()
#define repp(i,n) for(int (i)=1;(i)<=(n);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rev(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define clr(a) memset((a), 0 ,sizeof(a))

typedef pair<int,int> P;
typedef vector<pair<int,string> > pii;
typedef map<string,int> mdi;



int main(){
	int n;
	string s,s2;
	set<string> se;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> s;
		se.insert(s);
	}
	
	s="iaaeuu";
	s2="nbmgrz";
	sort(ALL(s));
	sort(ALL(s2));
	do{
		sort(ALL(s2));
		do{
			string ans="";
			for(int i=0;i<6;i++){
				ans+=s2.substr(i,1);
				ans+=s.substr(i,1);
			}
			for(int i=0;i<ans.size();i++){
				if(ans[i]=='z'){
					ans=ans.substr(0,i)+ans.substr(i+1);
					break;
				}
			}
			if(se.find(ans)==se.end()){
				cout << ans << endl;
				return 0;
			}
		}while(next_permutation(ALL(s2)));
	}while(next_permutation(ALL(s)));
	cout << "NO" << endl;
	return 0;
}
0