結果

問題 No.233 めぐるはめぐる (3)
ユーザー itezpaceitezpace
提出日時 2016-11-02 08:52:47
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,041 bytes
コンパイル時間 662 ms
コンパイル使用メモリ 69,608 KB
実行使用メモリ 22,864 KB
最終ジャッジ日時 2023-08-16 12:34:37
合計ジャッジ時間 5,744 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  vector<char> v1={'a','a','i','u','u','e'};
  vector<char> v2={'n','b','m','g','r'};
  vector<string> v3;
  for(int i=0;i<v1.size();++i){
    vector<char> v4=v1;
    char a=v4[i];
    v4.erase(v4.begin()+i);
    vector<char> v5=v2;
    do{
      do{
         string s1;
         for(int j=0;j<v5.size();++j){
           s1+=v5[j];
           s1+=v4[j];
         }
         for(int j=0;j<=s1.size();j+=2){
           string s2=s1;
           s2.insert(s2.begin()+j,a);
           v3.push_back(s2);
         }
      } while(next_permutation(v5.begin(),v5.end()));
    } while(next_permutation(v4.begin(),v4.end()));
  }
  int N;cin>>N;
  vector<string> v6;
  string S;
  for(int i=0;i<N;++i){
    cin>>S;
    v6.push_back(S);
  }
  for(int i=0;i<v3.size();++i){
    int f=0;
    for(int j=0;j<v6.size();++j){
      if(v3[i]==v6[j]){
        f=1;
        break;
      }
    }
    if(f==0){
      cout<<v3[i];
      break;
    }
  }
}
0