結果
| 問題 |
No.233 めぐるはめぐる (3)
|
| コンテスト | |
| ユーザー |
uenoku
|
| 提出日時 | 2016-12-02 01:14:21 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,139 bytes |
| コンパイル時間 | 841 ms |
| コンパイル使用メモリ | 93,152 KB |
| 実行使用メモリ | 13,568 KB |
| 最終ジャッジ日時 | 2024-11-27 16:54:59 |
| 合計ジャッジ時間 | 5,211 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 8 WA * 3 |
ソースコード
#include <algorithm>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
using namespace std;
typedef long long int lli;
typedef pair<lli, lli> P;
lli MOD = 1000000007;
int main()
{
char mt[6] = {'i', 'a', 'a', 'e', 'u', 'u'};
char pa[5] = {'m', 'g', 'r', 'n', 'b'};
sort(mt, mt + 6);
sort(pa, pa + 5);
set<string> s;
int n;
cin >> n;
string t;
rep(i, n)
{
cin >> t;
s.insert(t);
}
do {
do {
string tmp = "..........";
rep(i, 5) tmp[2 * i + 1] = mt[i];
rep(i, 5) tmp[2 * i] = pa[i];
rep(i, 10)
{
string a = tmp;
string b{mt[5]};
a.insert(i + 1, b);
if (s.find(a) == s.end()) {
cout << a << endl;
return 0;
}
}
} while (next_permutation(pa, pa + 5));
} while (next_permutation(mt, mt + 6));
}
uenoku