結果

問題 No.233 めぐるはめぐる (3)
ユーザー cielciel
提出日時 2015-06-27 00:04:10
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 154 ms / 1,000 ms
コード長 566 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 78,432 KB
実行使用メモリ 12,756 KB
最終ジャッジ日時 2023-09-22 02:39:12
合計ジャッジ時間 4,409 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 95 ms
12,148 KB
testcase_01 AC 55 ms
8,812 KB
testcase_02 AC 25 ms
5,880 KB
testcase_03 AC 71 ms
10,688 KB
testcase_04 AC 106 ms
12,380 KB
testcase_05 AC 122 ms
12,756 KB
testcase_06 AC 122 ms
12,464 KB
testcase_07 AC 154 ms
12,412 KB
testcase_08 AC 154 ms
12,468 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 58 ms
8,724 KB
testcase_13 AC 100 ms
12,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <unordered_set>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
	int N;
	unordered_set<string>se;
	for(cin>>N;N--;){
		string s;
		cin>>s;
		se.insert(s);
	}
	vector<char> x={0,'b','g','m','n','r'},y={'a','a','e','i','u','u'};
	do{
		do{
			string s;
			for(int i=0;i<6;i++){
				if(x[i])s+=x[i];
				s+=y[i];
			}
			if(se.find(s)==se.end()){
				cout<<s<<endl;
				return 0;
			}
		}while(next_permutation(y.begin(),y.end()));
	}while(next_permutation(x.begin(),x.end()));
	cout<<"NO"<<endl;
}
0