Skip to content

Commit

Permalink
Merge pull request #1288 from maspypy/1287
Browse files Browse the repository at this point in the history
テストケース追加(1287)
  • Loading branch information
maspypy authored Jan 5, 2025
2 parents d68e9b9 + 832a349 commit e49c01b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 0 deletions.
3 changes: 3 additions & 0 deletions polynomial/multipoint_evaluation/gen/issue_1287_00.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
4 4
0 0 0 1
1 2 0 3
45 changes: 45 additions & 0 deletions polynomial/multipoint_evaluation/gen/issue_1287_cpp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <iostream>
#include "random.h"

using namespace std;

int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);

int zero = 20;
int n = (1 << 17) - zero;
int m = (1 << 17);
vector<int> a(n + zero), b(m);

for (int i = 0; i < n; i++) { a[i] = gen.uniform((i != n - 1) ? 0 : 1, 998244352); }
for (int i = 0; i < m; i++) { b[i] = gen.uniform(0, 998244352); }

const int MOD = 998244353;
for (int i = 0; i < zero; i++) {
int v = gen.uniform(0, 998244353);
if (i < 10)
b[gen.uniform(0, m)] = (MOD - v) % MOD;
else
b[i] = (MOD - v) % MOD;
for (int j = n - 1; j >= 0; j--) {
a[j + 1] = (a[j + 1] + a[j]) % MOD;
a[j] = (long long)(a[j]) * (long long)(v) % MOD;
}
n++;
}

printf("%d %d\n", n, m);

for (int i = 0; i < n; i++) {
printf("%d", a[i]);
if (i != n - 1) printf(" ");
}
printf("\n");
for (int i = 0; i < m; i++) {
printf("%d", b[i]);
if (i != m - 1) printf(" ");
}
printf("\n");
return 0;
}
6 changes: 6 additions & 0 deletions polynomial/multipoint_evaluation/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
"example_00.out": "89bee91478eb45ef73901bfdbc28bbaa8468c003dc480f8881b3222f9bc7e956",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "de6aeb89b0d91519a443ac503ea9e652f130752e5ecc78cbcffc3e0f04e4bbf0",
"issue_1287_00.in": "24c5293f33bf38ab1c1d64f239a1736c69ab507d9d693c7abb43053107cc632c",
"issue_1287_00.out": "4e440e0688fe50b33a612be918cb0128462a2bea7b4f1972c89c49a04d3015e4",
"issue_1287_cpp_00.in": "7551d684fed0a3bb2b524ce5da628be67b83d0265a4cb3bfd8e92de5ea66d32a",
"issue_1287_cpp_00.out": "3f0ca4137cda8b0ba02f5b1c3abeea996fe3932a27ca6044a42ab66991c49b33",
"issue_1287_cpp_01.in": "baf531c8562b0b39f9a1bc9e513e1a8acbaa04da283449abeb7f2269cb5b4759",
"issue_1287_cpp_01.out": "b689a41bf8113edc0911bad9f798001fe4173b7f96033ff31c0ac3378e5bab4a",
"max_random_00.in": "bd75a638e1008099cf0a1366a652c8584e18f3c096473bdb8a464142673ee6ae",
"max_random_00.out": "de294de44c13cbc69e3d40c78af307493a90ee539d0acc5ed8b70946fb0c211f",
"max_random_01.in": "663c77c8cf1375ccc8a4d1ed95ce1bf91c988bb6ea517fcbc8b34852f2b963ee",
Expand Down
6 changes: 6 additions & 0 deletions polynomial/multipoint_evaluation/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,10 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/45"
[[tests]]
name = "zero.in"
number = 1
[[tests]]
name = "issue_1287.in"
number = 1
[[tests]]
name = "issue_1287_cpp.cpp"
number = 2

0 comments on commit e49c01b

Please sign in to comment.