結果

問題 No.233 めぐるはめぐる (3)
ユーザー omuomu
提出日時 2015-06-26 23:47:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 161 ms / 1,000 ms
コード長 1,305 bytes
コンパイル時間 1,044 ms
コンパイル使用メモリ 81,936 KB
実行使用メモリ 13,796 KB
最終ジャッジ日時 2023-09-22 01:49:18
合計ジャッジ時間 4,429 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 113 ms
13,068 KB
testcase_01 AC 68 ms
9,712 KB
testcase_02 AC 33 ms
6,612 KB
testcase_03 AC 77 ms
10,392 KB
testcase_04 AC 161 ms
13,548 KB
testcase_05 AC 133 ms
13,476 KB
testcase_06 AC 130 ms
13,536 KB
testcase_07 AC 159 ms
13,528 KB
testcase_08 AC 160 ms
13,796 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 70 ms
9,736 KB
testcase_13 AC 116 ms
13,444 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <set>

using namespace std;

#define For(i,a,b) for(int i = (a);i < (b);i++)
#define rep(i,n) For(i,0,n)

const int dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };
string dc[8] = { ">", "v", "<", "^", ">^", ">v", "<^", "<v" };

typedef pair<int, int> P;

int main(){

	int n;
	cin >> n;

	string s = "inabameguru";
	string bs = "iaaeuu";
	string cs = "nbmgr";
	sort(bs.begin(), bs.end());
	sort(cs.begin(), cs.end());

	set<string> se;

	rep(i, n){
		string t;
		cin >> t;
		se.insert(t);
	}
	do{
		do{

			rep(i, 5){
				string t;
				int tb = 0, tc = 0;

				rep(j, 11){
					if ((j % 2 == 0) && tc < 5){
						t += cs[tc++];
					}
					if (j % 2 && tb < 6){
						t += bs[tb++];
						if ((i * 2) + 1 == j)t += bs[tb++];
					}
				}
				if (!se.count(t)){
					cout << t << endl;
					return 0;
				}
			}

			string t;

			rep(j, 11){
				if ((j % 2)){
					t += cs[j / 2];
				}
				if (j % 2 == 0){
					t += bs[j / 2];
				}
			}
			if (!se.count(t)){
				cout << t << endl;
				return 0;
			}


		} while (next_permutation(bs.begin(), bs.end()));

	} while (next_permutation(cs.begin(), cs.end()));





	cout << "NO" << endl;

	return 0;
}
0