結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー | kimiyuki |
提出日時 | 2016-01-14 17:49:10 |
言語 | C++11 (gcc 11.4.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 916 bytes |
コンパイル時間 | 774 ms |
コンパイル使用メモリ | 78,476 KB |
実行使用メモリ | 12,640 KB |
最終ジャッジ日時 | 2023-10-19 23:05:43 |
合計ジャッジ時間 | 4,039 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 78 ms
12,376 KB |
testcase_01 | AC | 48 ms
8,992 KB |
testcase_02 | AC | 23 ms
6,156 KB |
testcase_03 | AC | 59 ms
10,576 KB |
testcase_04 | AC | 91 ms
12,640 KB |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 95 ms
12,640 KB |
testcase_08 | AC | 92 ms
12,640 KB |
testcase_09 | AC | 1 ms
4,348 KB |
testcase_10 | AC | 2 ms
4,348 KB |
testcase_11 | AC | 1 ms
4,348 KB |
testcase_12 | AC | 49 ms
8,992 KB |
testcase_13 | AC | 85 ms
12,640 KB |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <unordered_set> #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) using namespace std; int main() { int n; cin >> n; unordered_set<string> s; repeat (i,n) { string t; cin >> t; s.insert(t); } string vowels = "iaaeuu"; sort(vowels.begin(), vowels.end()); do { string consonants = "nbmgr"; sort(consonants.begin(), consonants.end()); do { string t; repeat (i, vowels.length() + consonants.length()) { t += (i % 2 == 0 ? vowels : consonants)[i / 2]; } if (not s.count(t)) { cout << t << endl; return 0; } } while (next_permutation(consonants.begin(), consonants.end())); } while (next_permutation(vowels.begin(), vowels.end())); cout << "NO" << endl; return 0; }