結果

問題 No.233 めぐるはめぐる (3)
ユーザー not_522not_522
提出日時 2015-08-20 14:27:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 592 bytes
コンパイル時間 1,397 ms
コンパイル使用メモリ 156,988 KB
実行使用メモリ 5,216 KB
最終ジャッジ日時 2023-09-25 13:49:29
合計ジャッジ時間 5,373 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
5,048 KB
testcase_01 AC 50 ms
5,200 KB
testcase_02 AC 30 ms
5,056 KB
testcase_03 AC 54 ms
5,068 KB
testcase_04 AC 71 ms
5,168 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 71 ms
5,192 KB
testcase_08 AC 71 ms
5,112 KB
testcase_09 AC 9 ms
5,008 KB
testcase_10 AC 9 ms
5,056 KB
testcase_11 AC 10 ms
5,112 KB
testcase_12 AC 49 ms
5,192 KB
testcase_13 AC 71 ms
5,104 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int main() {
  string a = "iaaeuu", b = "nbmgr";
  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  set<string> s;
  do {
    do {
      string str = a;
      for (size_t i = 0; i < b.size(); ++i) str.insert(2 * i + 1, 1, b[i]);
      s.insert(str);
    } while (next_permutation(b.begin(), b.end()));
  } while (next_permutation(a.begin(), a.end()));
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string str;
    cin >> str;
    s.erase(str);
  }
  if (s.empty()) cout << "NO" << endl;
  else cout << *(s.begin()) << endl;
}
0