結果
問題 |
No.233 めぐるはめぐる (3)
|
ユーザー |
|
提出日時 | 2019-02-13 17:07:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 764 bytes |
コンパイル時間 | 861 ms |
コンパイル使用メモリ | 79,192 KB |
実行使用メモリ | 13,568 KB |
最終ジャッジ日時 | 2024-09-13 10:29:27 |
合計ジャッジ時間 | 7,653 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 11 |
ソースコード
#include<iostream> #include<algorithm> #include<set> using namespace std; // 21600通り int main(){ int n; cin >> n; set<string> used; string s; for(int i = 0; i < n; i++){ cin >> s; used.insert(s); } string vowel = "aaeiuu", conso = "bgmnr"; // 重複を考慮しない雑な全探索・86400通り do{ do{ string t({vowel[0]}); for(int i = 0; i < 5; i++) t += conso.substr(i,1), t += vowel.substr(i,1); if(used.count(t) == 0){ cout << t << endl; return 0; } }while(next_permutation(conso.begin(), conso.end())); }while(next_permutation(vowel.begin(), vowel.end())); cout << "NO" << endl; return 0; }