結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-06-28 22:38:36 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 204 ms / 1,000 ms |
| コード長 | 984 bytes |
| コンパイル時間 | 1,590 ms |
| コンパイル使用メモリ | 170,500 KB |
| 実行使用メモリ | 13,568 KB |
| 最終ジャッジ日時 | 2024-07-07 20:55:19 |
| 合計ジャッジ時間 | 5,316 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 11 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrep2(i, a, b) for (int i = (a) - 1; i >= (b); i--)
using namespace std;
typedef long long ll;
const ll inf = 1e9;
const ll mod = 1e9 + 7;
int main() {
int N;
cin >> N;
set<string> s;
rep (i, N) {
string temp;
cin >> temp;
s.insert(temp);
}
string a = "nbmgr~";
string b = "iaaeuu";
sort(a.begin(), a.end());
sort(b.begin(), b.end());
do {
do {
string w;
rep (i, 6) {
if (a[i] != '~') w += a[i];
w += b[i];
}
if (!s.count(w)) {
cout << w << endl;
return 0;
}
} while (next_permutation(b.begin(), b.end()));
} while (next_permutation(a.begin(), a.end()));
cout << "NO" << endl;
}