diff --git a/math/pow_of_formal_power_series/gen/hack_00.in b/math/pow_of_formal_power_series/gen/hack_00.in new file mode 100644 index 000000000..11f162df3 --- /dev/null +++ b/math/pow_of_formal_power_series/gen/hack_00.in @@ -0,0 +1,2 @@ +1 2 +1 diff --git a/math/pow_of_formal_power_series/gen/monomial_ans_low_deg.cpp b/math/pow_of_formal_power_series/gen/monomial_ans_low_deg.cpp new file mode 100644 index 000000000..b683c693a --- /dev/null +++ b/math/pow_of_formal_power_series/gen/monomial_ans_low_deg.cpp @@ -0,0 +1,25 @@ +#include "random.h" +#include +#include "../params.h" + +using namespace std; +using ll = long long; + +int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); + + int k = seed % 4; + int n = gen.uniform(k + 1, N_MAX); + ll q_max = M_MAX; + if (k != 0) q_max = (n - 1) / k; + ll q = gen.uniform(0, q_max); + printf("%d %lld\n", n, q); + for (int i = 0; i < n; i++) { + int x = (i == k ? gen.uniform(1, MOD - 1) : 0); + printf("%d", x); + if (i != n - 1) printf(" "); + } + printf("\n"); + return 0; +} diff --git a/math/pow_of_formal_power_series/hash.json b/math/pow_of_formal_power_series/hash.json index d7386ba1d..042bd5ce4 100644 --- a/math/pow_of_formal_power_series/hash.json +++ b/math/pow_of_formal_power_series/hash.json @@ -15,6 +15,8 @@ "example_01.out": "f251ddc12234e0da8d3b778bd0f7463fb477f16f47757f5617dc8b4ff4d4f14a", "example_02.in": "bb73ad5448cb7852521b5cec14268f3fde5b5e7c0eb6090f6252af825cccd4b4", "example_02.out": "f4a8ae8e74ddfb896a256de4e3099911dcaa6a9302591713898069b0bcd6e3d7", + "hack_00.in": "a5687b5ea7e52470c569cd841e6e681128f1e6e49e3274c8061d97b4a708a11a", + "hack_00.out": "4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865", "lower_deg_zero2_00.in": "256a528efc282c3c6cfeefd1cc5b09467b6bd7a5bd4a2a06d0151e9ce6d4980e", "lower_deg_zero2_00.out": "2199a83cae4bebb4d3defb70d40797a532e84c79eb73577e212cc38a07df9f18", "lower_deg_zero2_01.in": "a7fc2a19ac0d29603edeedd5365f6debe0d25ae7b05d669a6b20b7b427185380", @@ -53,6 +55,14 @@ "monomial_02.out": "5a6ac1c2423f3b2e3ed7488817a53d157e6f8524a6b4ef2c8f1b399754821bc3", "monomial_03.in": "d71604f577b27032a7d9d9961c874d98cb66a13c4c8a68081a8eb53cb3620744", "monomial_03.out": "5a6ac1c2423f3b2e3ed7488817a53d157e6f8524a6b4ef2c8f1b399754821bc3", + "monomial_ans_low_deg_00.in": "1212f3fb3678d8f68fa5e4b12ece61b4d3be63bb35b836c03e87ede6287fba72", + "monomial_ans_low_deg_00.out": "901871f1971aed9366daea53fe311b43937b816b31d42e290a5dbd73702469fb", + "monomial_ans_low_deg_01.in": "ae43c424304becbeb3d8a59947833b6118fb6cad18c36f47ff854659e00089e2", + "monomial_ans_low_deg_01.out": "3e517d22dc55800446f9b80971e434cfe6d940c12498be5df72b384c641cb59c", + "monomial_ans_low_deg_02.in": "f25bf472316df759f4bb8491f14928f59dd95872d373c960a52a88fe11b0139e", + "monomial_ans_low_deg_02.out": "1752e32262248e464f800de3c1892ccea799bb9e014c9e2f0558748be873295d", + "monomial_ans_low_deg_03.in": "0d8ccae55bfa3ebb7d3a31bfaae600111e0b12ce4e1f3bd14ce8f4258f3c41bc", + "monomial_ans_low_deg_03.out": "a7fd12309fa7d754f1a2a179c58c3a74cfb650e7c22030a54b62df7e87736c64", "overflow_killer_00.in": "cf2edd30dfbe3ae828780d44a6f349cb61d5d57096982ae9486dba7119df382f", "overflow_killer_00.out": "2d82b8214d6923f1f32cfcaa45ac103e504e2dc88569caf2084d05c2180ab9c5", "overflow_killer_01.in": "4189924d300bce1691a76830e553247fb2d9ddb5b7f48d8061eb6afdf58a7e16", diff --git a/math/pow_of_formal_power_series/info.toml b/math/pow_of_formal_power_series/info.toml index 0ad793960..04de25a3f 100644 --- a/math/pow_of_formal_power_series/info.toml +++ b/math/pow_of_formal_power_series/info.toml @@ -20,6 +20,9 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/386" [[tests]] name = "monomial.cpp" number = 4 +[[tests]] + name = "monomial_ans_low_deg.cpp" + number = 4 [[tests]] name = "lower_deg_zero2.cpp" number = 4 @@ -32,6 +35,9 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/386" [[tests]] name = "M_zero.cpp" number = 2 +[[tests]] + name = "hack.in" + number = 1 [[solutions]] name = "wa_overflow.cpp"