Skip to content

Commit

Permalink
Merge pull request yosupo06#1060 from maspypy/issue_1021
Browse files Browse the repository at this point in the history
テストケース追加
  • Loading branch information
maspypy authored Nov 13, 2023
2 parents d0cc50f + ef79f4b commit f1322bb
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 0 deletions.
49 changes: 49 additions & 0 deletions math/convolution_mod_large/gen/medium_pre_suf_zero.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
// almost copy of midium.cpp

#include <cstdio>
#include "../params.h"
#include "random.h"

using namespace std;

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

int n = 1000; // fixed
int m = n; // fixed
vector<int> a(n), b(m);

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

// writing zeros
if (seed % 5 == 0) { a[0] = b[0] = 0; }
if (seed % 5 == 1) { a[n - 1] = b[m - 1] = 0; }
if (seed % 5 == 2) {
for (int i = 1; i < n; i++) a[i] = 0;
for (int i = 1; i < m; i++) b[i] = 0;
}
if (seed % 5 == 3) {
for (int i = 0; i < n - 1; i++) a[i] = 0;
for (int i = 0; i < m - 1; i++) b[i] = 0;
}
if (seed % 5 == 4) {
a[0] = b[0] = 0;
a[n - 1] = b[m - 1] = 0;
}
//

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;
}
10 changes: 10 additions & 0 deletions math/convolution_mod_large/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@
"medium_all_zero_01.out": "b963bc3f7a5d1c44e32a9ba1706fc8901775ea2a4d36c03557b3acd294881234",
"medium_all_zero_02.in": "a5f8c946774a8ab845a40b550ca82e913ecd2771164669a6be7ae567fd0fc5e9",
"medium_all_zero_02.out": "b7028092ec57a7e154029f9ba99a67b368375a97276c400db4d2e527abe6d91a",
"medium_pre_suf_zero_00.in": "49154b3c902f63729f04d84b3becff46424dca1b013d41c568a5700becc5fee0",
"medium_pre_suf_zero_00.out": "094ee7aa962d238b4b13aee7613d412658a0b7acde7fb0dd2c7913c953b3d89d",
"medium_pre_suf_zero_01.in": "3436514dc5afb288ab81041d713850407e856c1e3a43817b1c643ce61dbb7385",
"medium_pre_suf_zero_01.out": "8457bad3063034ff3c0fcc55a8c054f555f8c0265539b215d3ad84e0f54358b2",
"medium_pre_suf_zero_02.in": "2cecc086803878e8b1dbd8bb76a4d7caf027a172adbe27ee1e1438893dbe5eee",
"medium_pre_suf_zero_02.out": "aef7f2b2ca2e1e9732c944d50d9fd46bc25fdaa00c277ea53b4635242acce870",
"medium_pre_suf_zero_03.in": "09108a5357261de3fe86f0ebfbee6a247b5a520dfae35318c9bc546c09f00cdc",
"medium_pre_suf_zero_03.out": "b6be9e729f2dea17a522b2956ded4ade26396840972b97a3f05f0efd3bd0eca5",
"medium_pre_suf_zero_04.in": "a922e6478c58007e35da736763bc85de38cfecb654bfaa8f314aaf2f09177571",
"medium_pre_suf_zero_04.out": "c23b27ebb6670aee54f8f7d2bb61257f19419fed30a23489ea5e662de1b5a742",
"random_00.in": "ae898bd1117defc8c6f1b733beaaa2391c4af614bddda2a62ace30ee8dcba394",
"random_00.out": "87955ba0b2c231589ba298c98546b8bb5bcecf1d873107fea24dea6cb6bb0ed2",
"random_01.in": "d9a8e32da4358a60c833c48a2c0941e15d1460a507748d5d5824376b73e702ec",
Expand Down
3 changes: 3 additions & 0 deletions math/convolution_mod_large/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/720"
[[tests]]
name = "unsigned_overflow.cpp"
number = 1
[[tests]]
name = "medium_pre_suf_zero.cpp"
number = 5

[[solutions]]
name = "naive.cpp"
Expand Down

0 comments on commit f1322bb

Please sign in to comment.