結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
koyopro
|
| 提出日時 | 2015-10-18 00:18:01 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 927 bytes |
| コンパイル時間 | 1,699 ms |
| コンパイル使用メモリ | 168,300 KB |
| 実行使用メモリ | 13,568 KB |
| 最終ジャッジ日時 | 2024-07-21 16:43:12 |
| 合計ジャッジ時間 | 6,244 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 2 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
#define REP(i, n) for(int i=0; i<(n); i++)
#define ALL(a) (a).begin(),(a).end()
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
int N,T;
map<string, bool> has;
signed main()
{
cin >> N;
string s;
REP(i,N) {
cin >> s;
has[s] = true;
}
string vowels = "iaaeuu";
string consonants = "tnbmgr";
string t = "";
bool ok = false;
do {
do {
t = "";
REP(i,6) {
char c = consonants[i];
if (c != 't') t += c;
t += vowels[i];
}
if (!has[t]) {
ok = true;
break;
}
}while(next_permutation(ALL(consonants)));
if (ok) break;
}while(next_permutation(ALL(vowels)));
if (ok) {
cout << t << endl;
} else {
cout << "NO" << endl;
}
return 0;
}
koyopro