結果
問題 |
No.233 めぐるはめぐる (3)
|
ユーザー |
![]() |
提出日時 | 2015-06-26 23:44:45 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,304 bytes |
コンパイル時間 | 905 ms |
コンパイル使用メモリ | 80,508 KB |
実行使用メモリ | 13,440 KB |
最終ジャッジ日時 | 2024-07-07 18:37:31 |
合計ジャッジ時間 | 5,057 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 WA * 7 |
ソースコード
#include <iostream> #include <string> #include <algorithm> #include <vector> #include <functional> #include <queue> #include <set> using namespace std; #define For(i,a,b) for(int i = (a);i < (b);i++) #define rep(i,n) For(i,0,n) const int dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 }; string dc[8] = { ">", "v", "<", "^", ">^", ">v", "<^", "<v" }; typedef pair<int, int> P; int main(){ int n; cin >> n; string s = "inabameguru"; string bs = "iaaeuu"; string cs = "nbmgr"; sort(bs.begin(), bs.end()); sort(cs.begin(), cs.end()); set<string> se; rep(i, n){ string t; cin >> t; se.insert(t); } do{ do{ rep(i, 5){ string t; int tb = 0, tc = 0; rep(j, 11){ if ((j % 2 == 0) && tc < 5){ t += cs[tc++]; } if (j % 2 && tb < 6){ t += bs[tb++]; if ((i * 2) + 1 == j)t += bs[tb++]; } } if (!se.count(t)){ cout << t << endl; return 0; } } string t; rep(j, 11){ if ((j % 2)){ t += cs[j / 2]; } if (j % 2 == 0){ t += bs[j / 2]; } } if (se.count(t)){ cout << t << endl; return 0; } } while (next_permutation(bs.begin(), bs.end())); } while (next_permutation(cs.begin(), cs.end())); cout << "NO" << endl; return 0; }