結果
問題 | No.233 めぐるはめぐる (3) |
ユーザー | むらため |
提出日時 | 2019-01-26 21:15:39 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,250 bytes |
コンパイル時間 | 4,926 ms |
コンパイル使用メモリ | 188,896 KB |
実行使用メモリ | 12,788 KB |
最終ジャッジ日時 | 2023-10-19 02:50:39 |
合計ジャッジ時間 | 6,348 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 51 ms
12,464 KB |
testcase_01 | AC | 28 ms
9,080 KB |
testcase_02 | AC | 12 ms
6,192 KB |
testcase_03 | AC | 41 ms
10,664 KB |
testcase_04 | AC | 101 ms
12,728 KB |
testcase_05 | AC | 75 ms
12,728 KB |
testcase_06 | AC | 63 ms
12,728 KB |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | AC | 2 ms
4,348 KB |
testcase_10 | AC | 2 ms
4,348 KB |
testcase_11 | AC | 2 ms
4,348 KB |
testcase_12 | AC | 28 ms
9,080 KB |
testcase_13 | AC | 52 ms
12,728 KB |
ソースコード
#pragma GCC optimize("O3") #pragma GCC target("avx") #include "bits/stdc++.h" using namespace std; #define int long long #define REP(i, n) for (int i = 0; i < (n); i++) #define FOR(i, a, b) for (int i = (a); i < (b); i++) #define FORR(i, a, b) for (int i = (b - 1); i >= (a); i--) #define ALL(a) begin(a), end(a) #define let const auto int scan() { int result = 0; while (true) { auto k = getchar_unlocked(); if (k < '0' || k > '9') break; result = 10 * result + k - '0'; } return result; } string S = "aaeiuu"; string C = "bgmnr"; string SC = "aaeiuubgmnr"; auto used = unordered_set<string>(); bool check() { if (used.find(SC) == used.end()) { printf("%s\n", SC.c_str()); return true; } return false; } signed main() { let n = scan(); string cache = "inabameguru"; REP(_, n) { REP(i, 11) cache[i] = getchar_unlocked(); used.insert(cache); getchar_unlocked(); }; do { do { SC[0] = S[0]; REP(i, 5) { SC[i * 2 + 2] = S[i + 1]; SC[i * 2 + 1] = C[i]; } REP(i, 5) { if (check()) return 0; swap(SC[i * 2], SC[i * 2 + 1]); } if (check()) return 0; } while (next_permutation(ALL(C))); } while (next_permutation(ALL(S))); }