結果
| 問題 | No.233 めぐるはめぐる (3) | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2020-12-10 22:50:44 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 245 ms / 1,000 ms | 
| コード長 | 966 bytes | 
| コンパイル時間 | 985 ms | 
| コンパイル使用メモリ | 104,420 KB | 
| 実行使用メモリ | 13,696 KB | 
| 最終ジャッジ日時 | 2024-09-19 20:46:28 | 
| 合計ジャッジ時間 | 4,775 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 11 | 
ソースコード
#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;
			}
		}
	}
	cout << "NO" << endl;
}
            
            
            
        