結果

問題 No.233 めぐるはめぐる (3)
ユーザー 夜
提出日時 2020-12-10 22:50:17
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 943 bytes
コンパイル時間 1,033 ms
コンパイル使用メモリ 103,548 KB
実行使用メモリ 13,792 KB
最終ジャッジ日時 2023-10-20 00:57:42
合計ジャッジ時間 6,089 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 160 ms
13,388 KB
testcase_01 AC 92 ms
9,964 KB
testcase_02 AC 38 ms
6,800 KB
testcase_03 AC 104 ms
10,656 KB
testcase_04 AC 183 ms
13,792 KB
testcase_05 AC 282 ms
13,792 KB
testcase_06 AC 259 ms
13,792 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 92 ms
10,032 KB
testcase_13 AC 153 ms
13,632 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
set<string> st;
string c[6] = { "","n","b","m","g","r" };
string v[6] = { "i","a","a","e","u","u" };
vector<int> vec = { 0,1,2,3,4,5 }, vec1 = { 0,1,2,3,4,5 };
int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		st.insert(s);
	}
	if (st.find("inabameguru") == st.end()) {
		cout << "inabameguru" << endl;
		return 0;
	}
	while (next_permutation(vec.begin(), vec.end())) {
		while (next_permutation(vec1.begin(), vec1.end())) {
			string ans = "";
			for (int i = 0; i < 6; i++) {
				ans += c[vec[i]];
				ans += v[vec1[i]];
			}
			if (st.find(ans) == st.end()) {
				cout << ans << endl;
				return 0;
			}
		}
	}
}
0