結果

問題 No.233 めぐるはめぐる (3)
ユーザー IL_mstaIL_msta
提出日時 2015-06-26 23:42:30
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,388 bytes
コンパイル時間 760 ms
コンパイル使用メモリ 88,620 KB
実行使用メモリ 4,512 KB
最終ジャッジ日時 2023-09-22 01:46:39
合計ジャッジ時間 4,901 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 2 ms
4,440 KB
testcase_08 AC 3 ms
4,380 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 2 ms
4,512 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>

#include <algorithm>
#include <cmath>

#include <string>
#include <list>
#include <queue>
#include <vector>
#include <complex>
#include <set>

/////////
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
/////////
typedef long long LL;
typedef long double LD;
/////////
using namespace::std;
/////////
string name[30000];
int main(void){
    std::cin.tie(0); 
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed;//
    //cout << setprecision(6);//
	
	LL N;
	cin>>N;
	if(N>=21600){
		P("NO");
		return 0;
	}
	rep(i,N){
		cin>>name[i];
	}
	///////////////
	//inabameguru 
	//iaaeuu =6!/2!2!=180
	//nbmgr 5!=120
	
	vector<char> bo,si;
	bo.push_back('a');
	bo.push_back('a');
	bo.push_back('i');
	bo.push_back('u');
	bo.push_back('u');
	bo.push_back('e');
	si.push_back('n');
	si.push_back('b');
	si.push_back('m');
	si.push_back('g');
	si.push_back('r');

	vector<char>::iterator itrB;
	vector<char>::iterator itrS;
	string temp;
	do{
		do{
			temp = (bo[0]);
			for(int i=0;i<5;++i){
				temp += (si[i]);
				temp += (bo[i+1]);
			}
			for(int i=0;i<N;++i){
				if(temp != name[i] ){
					P(temp);
					return 0;
				}
			}
			temp = "";
		}while( next_permutation(bo.begin(), bo.end()) );
	}while( next_permutation(si.begin(), si.end()) );

	return 0;
}
0