From 4f4d5551c86b3d0f92efe8d53c72c953b5aae15c Mon Sep 17 00:00:00 2001 From: maspypy Date: Wed, 3 Jul 2024 18:03:36 +0900 Subject: [PATCH 1/2] add test --- math/polynomial_interpolation/gen/1169_00.in | 3 +++ math/polynomial_interpolation/hash.json | 2 ++ math/polynomial_interpolation/info.toml | 3 +++ 3 files changed, 8 insertions(+) create mode 100644 math/polynomial_interpolation/gen/1169_00.in diff --git a/math/polynomial_interpolation/gen/1169_00.in b/math/polynomial_interpolation/gen/1169_00.in new file mode 100644 index 000000000..d746bdba0 --- /dev/null +++ b/math/polynomial_interpolation/gen/1169_00.in @@ -0,0 +1,3 @@ +3 +0 1 2 +1 2 3 diff --git a/math/polynomial_interpolation/hash.json b/math/polynomial_interpolation/hash.json index 9508f63ea..d96e7b6ff 100644 --- a/math/polynomial_interpolation/hash.json +++ b/math/polynomial_interpolation/hash.json @@ -1,4 +1,6 @@ { + "1169_00.in": "01fa2df384d0e2d5a9a0f8a63c64935210f6c625ccfacd20dd5e8edab1234a64", + "1169_00.out": "63e9513edcd96636e7a78d2dc432a9d971f3ca5de1d1bcb4c8ffd2bcac8dd7c2", "example_00.in": "745a5014aa4ade554b909ed460261559945e0cb444366b1fc0711648895aaa3f", "example_00.out": "e085ba5d29787095f6e2bad7b1309b2ae13208e58bea570c84c0dd651de681b9", "example_01.in": "8f0ebdb9a3d767b099c3e12776d35d390525a3f6b28090aea0cfd82c1bfcea72", diff --git a/math/polynomial_interpolation/info.toml b/math/polynomial_interpolation/info.toml index e7a424a3d..fdc8a1f5b 100644 --- a/math/polynomial_interpolation/info.toml +++ b/math/polynomial_interpolation/info.toml @@ -11,3 +11,6 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/46" [[tests]] name = "max_random.cpp" number = 2 +[[tests]] + name = "1169.in" + number = 1 From 7a32367370901374598446809f5b6c5e5eb9b5f2 Mon Sep 17 00:00:00 2001 From: maspypy Date: Thu, 4 Jul 2024 03:02:40 +0900 Subject: [PATCH 2/2] add test --- math/polynomial_interpolation/gen/x_zero.cpp | 30 ++++++++++++++++++++ math/polynomial_interpolation/hash.json | 4 ++- math/polynomial_interpolation/info.toml | 3 ++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 math/polynomial_interpolation/gen/x_zero.cpp diff --git a/math/polynomial_interpolation/gen/x_zero.cpp b/math/polynomial_interpolation/gen/x_zero.cpp new file mode 100644 index 000000000..df2c27a78 --- /dev/null +++ b/math/polynomial_interpolation/gen/x_zero.cpp @@ -0,0 +1,30 @@ +#include +#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 x = gen.choice(n, 1, 998244352); // avoid zero + vector y(n); + for (int i = 0; i < n; i++) { y[i] = gen.uniform(0, 998244352); } + + int idx = gen.uniform(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; +} diff --git a/math/polynomial_interpolation/hash.json b/math/polynomial_interpolation/hash.json index d96e7b6ff..b7b9e6ec3 100644 --- a/math/polynomial_interpolation/hash.json +++ b/math/polynomial_interpolation/hash.json @@ -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" } \ No newline at end of file diff --git a/math/polynomial_interpolation/info.toml b/math/polynomial_interpolation/info.toml index fdc8a1f5b..dbbd9aa0e 100644 --- a/math/polynomial_interpolation/info.toml +++ b/math/polynomial_interpolation/info.toml @@ -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