結果

問題 No.233 めぐるはめぐる (3)
ユーザー むらためむらため
提出日時 2019-01-26 21:24:58
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,379 bytes
コンパイル時間 2,635 ms
コンパイル使用メモリ 188,856 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-18 23:12:54
合計ジャッジ時間 6,095 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 4 WA * 7
権限があれば一括ダウンロードができます
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/exception_ptr.h:43,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/exception:168,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ios:39,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/istream:38,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/sstream:38,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/complex:45,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ccomplex:39,
                 from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/x86_64-pc-linux-gnu/bits/stdc++.h:54,
                 from main.cpp:3:
In function 'std::_Require<std::__not_<std::__is_tuple_like<_Tp> >, std::is_move_constructible<_Tp>, std::is_move_assignable<_Tp> > std::swap(_Tp&, _Tp&) [with _Tp = char]',
    inlined from 'void std::iter_swap(_ForwardIterator1, _ForwardIterator2) [with _ForwardIterator1 = char*; _ForwardIterator2 = char*]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algobase.h:182:11,
    inlined from 'void std::__reverse(_RandomAccessIterator, _RandomAccessIterator, random_access_iterator_tag) [with _RandomAccessIterator = char*]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algo.h:1107:18,
    inlined from 'bool std::__next_permutation(_BidirectionalIterator, _BidirectionalIterator, _Compare) [with _BidirectionalIterator = char*; _Compare = __gnu_cxx::__ops::_Iter_less_iter]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algo.h:2907:22,
    inlined from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = char*]' at /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/bits/stl_algo.h:2947:2,
    inlined from 'int main()' at main.cpp:57:30:
/

ソースコード

diff #
プレゼンテーションモードにする

#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;
}
char S[] = "aaeiuu\0";
char C[] = "bgmnr\0";
char SC[] = "aaeiuubgmnr\0";
// struct eq {bool operator()(){}};
auto used = unordered_set<char*>();
bool check() {
if (used.find(SC) == used.end()) {
printf("%s\n", SC);
return true;
}
return false;
}
signed main() {
let n = scan();
if (n == 129600) { //
printf("NO\n");
return 0;
}
char cache[] = "inabameguru\0";
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)));
}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0