結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-01 18:00:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 775 bytes |
| コンパイル時間 | 1,979 ms |
| コンパイル使用メモリ | 178,148 KB |
| 実行使用メモリ | 7,424 KB |
| 最終ジャッジ日時 | 2024-11-06 17:25:27 |
| 合計ジャッジ時間 | 5,970 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 WA * 2 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
char consonant[] = {'n', 'b', 'm', 'g', 'r'};
char vowel[] = {'i', 'a', 'a', 'e', 'u', 'u'};
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
set<string> candidate;
do {
do {
string s[6] = {};
for (int i = 0; i < 5; i++) {
s[i] += vowel[5];
for (int j = 0; j < 6; j++) {
s[j] += consonant[i];
s[j] += vowel[i];
}
}
s[5] += vowel[5];
for (int i = 0; i < 6; i++) {
candidate.insert(s[i]);
}
} while (next_permutation(vowel, vowel + 6));
} while (next_permutation(consonant, consonant + 5));
int n;
cin >> n;
for (int i = 0; i < n; i++) {
string s;
cin >> s;
candidate.erase(s);
}
cout << (candidate.empty() ? "NO" : *candidate.begin()) << endl;
return 0;
}