結果

問題 No.233 めぐるはめぐる (3)
ユーザー 158b158b
提出日時 2015-06-26 23:51:40
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,149 bytes
コンパイル時間 965 ms
コンパイル使用メモリ 81,004 KB
実行使用メモリ 9,068 KB
最終ジャッジ日時 2023-09-22 01:53:11
合計ジャッジ時間 4,568 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
8,404 KB
testcase_01 AC 31 ms
8,396 KB
testcase_02 AC 17 ms
5,368 KB
testcase_03 AC 34 ms
7,612 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 32 ms
8,980 KB
testcase_13 AC 66 ms
7,536 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
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 data = "inabameguru";
	string data1 = "iaaeuu";
	string data2 = "nbmgr";
	string check;
	int check1[6] = {0,1,2,3,4,5};
	int check2[5] = {0,1,2,3,4};
	bool flg = true;
	
	cin >> n;
	for(int i=0; i<n; i++){
		cin >> in;
		s.push_back(in);
	}
	
	do{
		do{
			check = "";
			for(int i=0; i<5; i++){
				check += data1[ check1[i] ];
				check += data2[ check2[i] ];
			}
			check += data1[5];
			
			flg = true;
			for(int i=0; i<n; i++){
				if(check == s[i]){
					flg = false;
					break;
				}
			}
			
			if(flg){
				cout << check << endl;
				break;
			}
		
		}while( next_permutation(check2, check2 + 5) && !flg);
	}while( next_permutation(check1, check1 + 6) && !flg);
	
    
    return 0;
}
0