結果

問題 No.233 めぐるはめぐる (3)
ユーザー IL_mstaIL_msta
提出日時 2015-06-27 00:12:41
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,500 bytes
コンパイル時間 703 ms
コンパイル使用メモリ 89,224 KB
実行使用メモリ 34,908 KB
最終ジャッジ日時 2023-09-22 02:43:14
合計ジャッジ時間 3,980 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 21 ms
34,608 KB
testcase_02 AC 17 ms
34,592 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 14 ms
34,616 KB
testcase_08 AC 13 ms
34,668 KB
testcase_09 AC 13 ms
34,588 KB
testcase_10 AC 13 ms
34,688 KB
testcase_11 AC 13 ms
34,612 KB
testcase_12 AC 19 ms
34,804 KB
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[1000000];
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>=86400){
		P("NO");
		return 0;
	}
	else if(N==0){
		P("inabameguru");
		return 0;
	}
	rep(i,N){
		cin>>name[i];
	}
	///////////////
	//inabameguru 
	//iaaeuu =6!/2!2!=180
	//nbmgr 5!=120
	
	
	vector<char> si;
	si.push_back('n');
	si.push_back('b');
	si.push_back('m');
	si.push_back('g');
	si.push_back('r');

	string temp;
	int count;
	do{
		vector<char> bo;
		bo.push_back('a');
		bo.push_back('a');
		bo.push_back('i');
		bo.push_back('u');
		bo.push_back('u');
		bo.push_back('e');
		do{
			temp = (bo[0]);
			for(int i=0;i<5;++i){
				temp += (si[i]);
				temp += (bo[i+1]);
			}
			count = 0;
			for(int i=0;i<N;++i){
				if(temp != name[i] ){
					++count;
				}else{
					break;
				}
			}
			if(count == N){
				P(temp);
				return 0;
			}
			temp = "";
		}while( next_permutation(bo.begin(), bo.end()) );

	}while( next_permutation(si.begin(), si.end()) );
	P("NO");
	return 0;
}
0