結果
問題 |
No.233 めぐるはめぐる (3)
|
ユーザー |
![]() |
提出日時 | 2015-06-26 23:51:40 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,149 bytes |
コンパイル時間 | 744 ms |
コンパイル使用メモリ | 81,192 KB |
実行使用メモリ | 7,504 KB |
最終ジャッジ日時 | 2024-07-07 18:42:56 |
合計ジャッジ時間 | 4,120 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 5 |
ソースコード
#include <iostream> #include <algorithm> #include <functional> #include <string> #include <climits> #include <vector> #include <numeric> #include <complex> #include <map> #include <bitset> using namespace std; //#define __int64 long long #define long __int64 #define REP(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) REP(i,0,n) const int Vecy[4] = {0,-1,0,1}; const int Vecx[4] = {1,0,-1,0}; int main(){ int n; vector<string> s; string in; string data = "inabameguru"; string data1 = "iaaeuu"; string data2 = "nbmgr"; string check; int check1[6] = {0,1,2,3,4,5}; int check2[5] = {0,1,2,3,4}; bool flg = true; cin >> n; for(int i=0; i<n; i++){ cin >> in; s.push_back(in); } do{ do{ check = ""; for(int i=0; i<5; i++){ check += data1[ check1[i] ]; check += data2[ check2[i] ]; } check += data1[5]; flg = true; for(int i=0; i<n; i++){ if(check == s[i]){ flg = false; break; } } if(flg){ cout << check << endl; break; } }while( next_permutation(check2, check2 + 5) && !flg); }while( next_permutation(check1, check1 + 6) && !flg); return 0; }