結果

問題 No.233 めぐるはめぐる (3)
ユーザー E31415926E31415926
提出日時 2017-02-21 21:12:54
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 158 ms / 1,000 ms
コード長 761 bytes
コンパイル時間 1,538 ms
コンパイル使用メモリ 173,684 KB
実行使用メモリ 13,680 KB
最終ジャッジ日時 2023-08-28 23:40:45
合計ジャッジ時間 5,033 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
13,076 KB
testcase_01 AC 65 ms
9,704 KB
testcase_02 AC 31 ms
6,608 KB
testcase_03 AC 79 ms
10,344 KB
testcase_04 AC 158 ms
13,628 KB
testcase_05 AC 140 ms
13,680 KB
testcase_06 AC 132 ms
13,676 KB
testcase_07 AC 155 ms
13,496 KB
testcase_08 AC 152 ms
13,480 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 67 ms
9,736 KB
testcase_13 AC 112 ms
13,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
#define int long long
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define INF (1ll<<60)
typedef pair<int, int> pii;
#define FI first
#define SE second
#define all(s) s.begin(),s.end()
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)

int N;
set<string> S;

void rekkyo() {
	string bo = "aaeiuu";
	string si = "bgmnr";
	do {
		do {
			rep(i,5)
			{
				string t;
				rep(j,5)
				{
					if (i == j)
						t += bo[5];
					t += si[j];
					t += bo[j];
				}
				if (!S.count(t)) {
					cout << t << endl;
					return;
				}
			}
		} while (next_permutation(all(si)));
	} while (next_permutation(all(bo)));
	cout << "NO" << endl;
}

signed main() {
	cin >> N;
	rep(i,N)
	{
		string s;
		cin >> s;
		S.insert(s);
	}
	rekkyo();
}
0