Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
maspypy committed Jul 3, 2024
1 parent 4f4d555 commit 7a32367
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
30 changes: 30 additions & 0 deletions math/polynomial_interpolation/gen/x_zero.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <iostream>
#include "random.h"

using namespace std;

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

int n = (1 << 17);
vector<int> x = gen.choice(n, 1, 998244352); // avoid zero
vector<int> y(n);
for (int i = 0; i < n; i++) { y[i] = gen.uniform(0, 998244352); }

int idx = gen.uniform<int>(0, n - 1);
x[idx] = 0;

printf("%d\n", n);
for (int i = 0; i < n; i++) {
printf("%d", x[i]);
if (i != n - 1) printf(" ");
}
printf("\n");
for (int i = 0; i < n; i++) {
printf("%d", y[i]);
if (i != n - 1) printf(" ");
}
printf("\n");
return 0;
}
4 changes: 3 additions & 1 deletion math/polynomial_interpolation/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,7 @@
"random_01.in": "3f277d067e254684f93b173a5405ca85656ebc3cc5a1fe926915aec58c4e40c5",
"random_01.out": "a0b93bf865afafc2572c9aac67a4436783b61d7f6a8be134f9bc57d6733731e4",
"random_02.in": "c1fa3c399be5c03fdc49f685a50d23d208454f0fdbc247b287e56716abced21f",
"random_02.out": "307ad8b9e2da40a0319605e91126fe88b3eff1d9415a0069f64dd5ed858b92b6"
"random_02.out": "307ad8b9e2da40a0319605e91126fe88b3eff1d9415a0069f64dd5ed858b92b6",
"x_zero_00.in": "a70c2efb776b7654bcabff3582dc215da344650483826a59283834b2998e74a3",
"x_zero_00.out": "63d84105de9685f46d7ebaf80c864e0a1934a1c04a03ad407041f3736c7d5217"
}
3 changes: 3 additions & 0 deletions math/polynomial_interpolation/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/46"
[[tests]]
name = "1169.in"
number = 1
[[tests]]
name = "x_zero.cpp"
number = 1

0 comments on commit 7a32367

Please sign in to comment.