結果
| 問題 | No.233 めぐるはめぐる (3) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-01-26 21:24:21 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,371 bytes |
| 記録 | |
| コンパイル時間 | 2,796 ms |
| コンパイル使用メモリ | 209,232 KB |
| 実行使用メモリ | 7,976 KB |
| 最終ジャッジ日時 | 2026-04-07 01:15:38 |
| 合計ジャッジ時間 | 6,956 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 4 WA * 7 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_pair.h:61,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algobase.h:64,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/algorithm:62,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:53,
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/15.2.0_1/include/c++/15/bits/stl_algobase.h:186:11,
inlined from 'void std::__reverse(_RandomAccessIterator, _RandomAccessIterator, random_access_iterator_tag) [with _RandomAccessIterator = char*]' at /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algo.h:1046: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/15.2.0_1/include/c++/15/bits/stl_algo.h:2923:22,
inlined from 'bool std::next_permutation(_BIter, _BIter) [with _BIter = char*]' at /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/stl_algo.h:2963:2,
inlined from 'int main()' at main.cpp:57:30:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/move.h:236:11: warning: writing 8 bytes into a region of size 5 [-Wstringop-overflow=]
236 | __a = _GLIBCXX_MOVE(__b);
| ^
main.cpp: In function 'int main()':
main.cpp:22:6: note: at offset [1, 2] into destination object 'C' of size 6
22 | char C[] = "bgmnr";
| ^
main.cpp:22:6: note
ソースコード
#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";
char C[] = "bgmnr";
char SC[] = "aaeiuubgmnr";
// 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";
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)));
}