結果

問題 No.233 めぐるはめぐる (3)
ユーザー 158b158b
提出日時 2015-06-28 14:22:37
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 117 ms / 1,000 ms
コード長 1,088 bytes
コンパイル時間 952 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 9,156 KB
最終ジャッジ日時 2023-09-22 03:46:07
合計ジャッジ時間 4,747 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
8,188 KB
testcase_01 AC 54 ms
7,680 KB
testcase_02 AC 27 ms
5,048 KB
testcase_03 AC 61 ms
8,000 KB
testcase_04 AC 115 ms
7,996 KB
testcase_05 AC 97 ms
8,604 KB
testcase_06 AC 92 ms
8,560 KB
testcase_07 AC 115 ms
8,484 KB
testcase_08 AC 117 ms
7,560 KB
testcase_09 AC 2 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 55 ms
7,788 KB
testcase_13 AC 85 ms
9,156 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
#include <set>
using namespace std;

//#define __int64 long long
#define long __int64
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
const int Vecy[4] = {0,-1,0,1};
const int Vecx[4] = {1,0,-1,0};


int main(){
	int n;
	vector<string> s;
	string in;
	string data1 = "aaeiuu";
	string data2 = "bgmnr*";
	string check;
	char check1[6] = {'a','a','e','i','u','u'};
	char check2[6] = {'b','g','m','n','r','*'};
	bool flg = false;
	
	cin >> n;
	
	rep(i,n){
		cin >> in;
		s.push_back(in);
	}
	
	sort(s.begin(), s.end());
	
	do{
		do{
			check = "";
			rep(i,6){
				if(check2[i] != '*') check += check2[i];
				check += check1[i];
			}
			
			if(!binary_search(s.begin(), s.end(), check)){
				cout << check << endl;
				return 0;
			}
		
		}while( next_permutation(check2, check2 + 6));
	}while( next_permutation(check1, check1 + 6));
	
	
	cout << "NO" << endl;
    
    return 0;
}
0