Skip to content

Commit

Permalink
add sqrt(MOD) split variant
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Nov 21, 2024
1 parent 744d0da commit 620cc13
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 48 deletions.
6 changes: 3 additions & 3 deletions convolution/convolution_mod/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ using namespace std;
int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);
auto sub = seed % 2 ? 1000 : 10;
auto div = seed % 2 ? 1 : 2;
auto sub = (seed & 1) ? 1000 : 10;
auto div = (seed & 2) ? 1 : 2;

int n = N_AND_M_MAX;
int m = N_AND_M_MAX;
vector<int> a(n), b(m);
constexpr int B = 1<<15;
const int B = (seed & 4) ? 1<<15 : std::sqrt(MOD);
for (int i = 0; i < n; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
Expand Down
24 changes: 16 additions & 8 deletions convolution/convolution_mod/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
"example_00.out": "bed182fa28059c3a153ceb69a5293edb94f3984e7df500c7d5b0deb991bedfe4",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "6f3fe32c2ab1bc6522fb407ec92377205c8c6c17e457f4d50cda2c0f0764cf61",
"fft_killer_00.in": "89539236b90b3150196b177ee5373aca791362f37474e7c41fa32b8bd91fed5f",
"fft_killer_00.out": "00fbc3b7d34228f9091d6644065643acc5b2e59f59ded12d071755fc4c33e922",
"fft_killer_01.in": "a624e97bd32fbb1a2f76534f29072b8ef97cb1cc32e2e30c43d61ecb57d450db",
"fft_killer_01.out": "64b26ddc3943011647852260b5b41c805cddb8981d38785a95fedce3dcf379c4",
"fft_killer_02.in": "76a6a4d3e9c68b962e1f1492617b9215d87a03cb94ac2fd947d815e173c4f540",
"fft_killer_02.out": "0ba591e33d2480a7cc6d0d619e2896e13d08f17d4af669c2c880d75b8d53b802",
"fft_killer_03.in": "0582b443660597cfe426bb3b9aeb1ff0caefded993542b3dbd1ec2063a0c422f",
"fft_killer_03.out": "a5c7bf7d0318d8dbe52fc37b0991e996f36bdc2ec528c4c8cbbd8bfc6cac87c7",
"fft_killer_00.in": "0649651eb4412dd2929d66ff13899041c5157c15f918fdd71048c2f8f7000ef8",
"fft_killer_00.out": "fd6225d9747efef52850f5bbc3b5c2096a5f0130627b7cb601501c28af5117e4",
"fft_killer_01.in": "6b67107ebd97e60fbe1e799803aeea94996397ac370dd551a00ad40b43368323",
"fft_killer_01.out": "d45692fc07a61e18f5a3c93077eae0bdfb7a5bb358f6414137d316852e06c920",
"fft_killer_02.in": "ebef6f1e99b072b620a648d1508c7cd20b0c9a6a921b53e6fbdfa69574aed524",
"fft_killer_02.out": "37a5a759f4ec1b7b27d4c2216be46ff87545a439b35723f8c3567dd8fccb7791",
"fft_killer_03.in": "3b4d43c2a3a3415a1e496201c9a12d39b450a9330a379318417742ff8e01c12e",
"fft_killer_03.out": "490e439df77f6854f2a7696a983579d51d477249802454a08201a4fbb2ed0441",
"fft_killer_04.in": "7b0e3327560f1e0d1b28fe73f10f4f94f0e16014ba84b6d1037cc80eb825387b",
"fft_killer_04.out": "e07cacdd58b0d8eaa0ae11be376a77c8eba3458d1c8bf55d2774de41379a6d50",
"fft_killer_05.in": "c18ab96d03f042ccb65e103dc7f83b182fc3163a4c3cd999c4cbd51730d8447f",
"fft_killer_05.out": "b9df91d4ea4acb3a13d55253dc80de10ec874d1ef50cfe9ed32283c4ba1b7308",
"fft_killer_06.in": "bdafee66fcf18b933d63e89a71a399b5aad91c9c2a9c57188f30b529f530e691",
"fft_killer_06.out": "36072d8b84c03ea2a0139c376a14cd399491080b3cea4df8147c346c7a9a7720",
"fft_killer_07.in": "b3d9ef4b322b69680b6429a9271381e2759461e3a034bdcda70912a676731c42",
"fft_killer_07.out": "46a768ca5353d070e3fa1ff7219a455f63a8d7ce47f1bc900005c84e3b14c6aa",
"max_ans_zero_00.in": "45932122a32f92e6a87b35cd980553a17082807a7f54c5594c92de911f88e181",
"max_ans_zero_00.out": "cf578ce195922f9426f41d7c7f4fbb67673d66b58d900b42ec18808b53c79dea",
"max_random_00.in": "3bbe45c5ce2820f3961db9f5746dfad939c09cb78d62bb1f9729ff3ac83e4208",
Expand Down
2 changes: 1 addition & 1 deletion convolution/convolution_mod/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/42"
number = 2
[[tests]]
name = "fft_killer.cpp"
number = 4
number = 8
[[tests]]
name = "medium_all_zero.cpp"
number = 1
Expand Down
6 changes: 3 additions & 3 deletions convolution/convolution_mod_1000000007/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ using namespace std;
int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);
auto sub = seed % 2 ? 1000 : 10;
auto div = seed % 2 ? 1 : 2;
auto sub = (seed & 1) ? 1000 : 10;
auto div = (seed & 2) ? 1 : 2;

int n = N_AND_M_MAX;
int m = N_AND_M_MAX;
vector<int> a(n), b(m);
constexpr int B = 1<<15;
const int B = (seed & 4) ? 1<<15 : std::sqrt(MOD);
for (int i = 0; i < n; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
Expand Down
24 changes: 16 additions & 8 deletions convolution/convolution_mod_1000000007/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
"example_00.out": "bed182fa28059c3a153ceb69a5293edb94f3984e7df500c7d5b0deb991bedfe4",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "e02b7be488d77085ccc6ca2b616fb26d0148b42d1fd998229f89651f7922a2ed",
"fft_killer_00.in": "06796d23dedc96bd6e7d51683560025fde7cd8c0e5619f209095f5ad54a12265",
"fft_killer_00.out": "29692271314d1a8f082ff66bcd1a00b55522519c2868c2903b2f6cb864a0aafc",
"fft_killer_01.in": "ad873a6f5d5657d270160f8ffe65d9abd56f41adf4cffdc86202136430e42f35",
"fft_killer_01.out": "76826553c1c8b3ddb37cd04b15348e4b5e0a7360eb4c2eea4be06b3e2668e482",
"fft_killer_02.in": "b21681739b9720e5569221803f65772258081da7c51a2f8c92692105fb87cddf",
"fft_killer_02.out": "fb5a42af4ea2d58d08e97ddbff776df1cd1f4d6fe709e4d180b95c016346b450",
"fft_killer_03.in": "b065127d09d03c774b1e38b518c440d4c2f0137d5577e518d99c439b39f4c08f",
"fft_killer_03.out": "8b55a81cb21c7edba008a1a15d9220ce4d4f40a94b1f99c2c4a7c1cba8c688e8",
"fft_killer_00.in": "66a7e98bbb316492f23402c1a9000116a1d1a739fa84685a85b783d65b16d172",
"fft_killer_00.out": "a0703cfa3551be3fe5f200d57c7fd7f60b4f18ef63d0acbd31a381921eaf99e8",
"fft_killer_01.in": "420312a28ab2f1c0cb94d16b9c308f1f7867810a2441faa130cf4d8006edc6f2",
"fft_killer_01.out": "f3957243100bfa525e9d219536076a465409b3f14c0e46471d1e144cb1d03ee0",
"fft_killer_02.in": "2e22255ede8bf8e41fd67bf5f55f051d2f2501913d30c8deb733771518f7da86",
"fft_killer_02.out": "b55c19298678bad58b142e20e568324383015d2d693e5ab83f375d83df509a3f",
"fft_killer_03.in": "4408e21ef4b219f8ffcafdb1d0cdc6b5c75797c0bc7454c7640ff17b92739fef",
"fft_killer_03.out": "b740283bd7840c30ec807cf8563f01f6cecf13e5035221d02429c66d263c6ad4",
"fft_killer_04.in": "b1fc6ac41d474348b4c08f674650a1cfc93d9f616005450dfbf9200138bd82f5",
"fft_killer_04.out": "d08c914433bf77e4097558f654c61cdf0b0c2dbadf96ad33da7d7417e5d95fc5",
"fft_killer_05.in": "f188ce31bd4d3f5485a9adc83db266fc2f12368931c497ba71f7a2459f429a4e",
"fft_killer_05.out": "12993379d1151cec0fcaf2fa372205d2afed7d147fb873a28aabeab2ae3be16f",
"fft_killer_06.in": "022bb267e8661fc7b7ea1d4da3579550660c12571b7b8d5082795fe64cedfd84",
"fft_killer_06.out": "4e9fd3f9e3162d0a8c3f70a214346446ad68d6cabdaf5967e290a35524eadfbf",
"fft_killer_07.in": "277f075c0f6543ff72be90ba55c4841f1638a10c570e9a60e771c95cf91dabc7",
"fft_killer_07.out": "04d4bd4f0ded08fc76870fee800302a10818c3a0ec7dcd32ca941be518786126",
"max_ans_zero_00.in": "fdf42aae02c3335ed46b91a0c98bb6ebf4e468110ce13deebc06fb3eede67bf9",
"max_ans_zero_00.out": "cca48cb670a6b7b1d2d7606ce4f0eec1c160a63e34da0b8dc8532166e18ca652",
"max_random_00.in": "7c7a885e1d1534bbf7ae71c1f26a92ffda9369b6800a9dc02d43b61934432e70",
Expand Down
2 changes: 1 addition & 1 deletion convolution/convolution_mod_1000000007/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/145"
number = 2
[[tests]]
name = "fft_killer.cpp"
number = 4
number = 8
[[tests]]
name = "medium_all_zero.cpp"
number = 1
Expand Down
6 changes: 3 additions & 3 deletions convolution/convolution_mod_large/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ using namespace std;
int main(int, char* argv[]) {
long long seed = atoll(argv[1]);
auto gen = Random(seed);
auto sub = seed % 2 ? 1000 : 10;
auto div = seed % 2 ? 1 : 2;
auto sub = (seed & 1) ? 1000 : 10;
auto div = (seed & 2) ? 1 : 2;

int n = N_AND_M_MAX;
int m = N_AND_M_MAX;
vector<int> a(n), b(m);
constexpr int B = 1 << 15;
const int B = (seed & 4) ? 1<<15 : std::sqrt(MOD);
for (int i = 0; i < n; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
Expand Down
24 changes: 16 additions & 8 deletions convolution/convolution_mod_large/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
"example_00.out": "bed182fa28059c3a153ceb69a5293edb94f3984e7df500c7d5b0deb991bedfe4",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "6f3fe32c2ab1bc6522fb407ec92377205c8c6c17e457f4d50cda2c0f0764cf61",
"fft_killer_00.in": "4094e9e44fa65cfb96ab58726f44c4607ac8640baf5f25a758a44fcf64fd2817",
"fft_killer_00.out": "c80639dcf2b1780ae26e792ff17dcb92dbf609a6e45b7d7500322cbcf6b9dc7a",
"fft_killer_01.in": "0a1c1a4baf06a0faddcddc2e455238037aeae65e317eb57f86c39b825c5bfddf",
"fft_killer_01.out": "1c15ba7aae24821fcf18539d477e877dfa423cd286b351a4af15042d0466a8df",
"fft_killer_02.in": "25d9e4429f7d6e66700a46660652f1c86fac194e54b18b4fbc923fb2038c8801",
"fft_killer_02.out": "180f4866e3142d932e91d7e21049dd2160fedc4aab619fed4993a0104befffc3",
"fft_killer_03.in": "08445bbeca62e11606d08a6e6066e89cbee74f4ebe979dd87da66cef548e9bb8",
"fft_killer_03.out": "f3f7aedc49ed299217c82d4de9a4edb3ae85878a1a9c6c3acf2af923d3f61755",
"fft_killer_00.in": "1a781b1998352598df1c0d8d3a48b9352724af3afe1088efa6d854956b31ee71",
"fft_killer_00.out": "fdbd5cd469b733de948a13d84296bb0884e7f092d1414afb878a0682fa22dbb3",
"fft_killer_01.in": "f420661151f81809ff5de6ed38ac5bbb498a6b4d95e44a5e4a0fa0e6885f0edf",
"fft_killer_01.out": "5cf900da2cf2303e47c209f7daa62f76b2a4194cecdef85d190f1d99a434d644",
"fft_killer_02.in": "886dbf398cc5a7ced4c8fdecdf2711ec9473f964f42da2c443221b7142cac3dd",
"fft_killer_02.out": "c721238a2695308f5b91be394ddc6ecfc130571d905810104b33e699947724d4",
"fft_killer_03.in": "8b2e0311ae2728233eacae17737addf73f7426417175449b8a94b51e2ee0481d",
"fft_killer_03.out": "a2ae63da1517aa9850def3e741dc6218dbcb773e23d202b0b6e9153d55657907",
"fft_killer_04.in": "2af9f48aac28812d67e6c46ad06941820e6c0ac4664de181125e80ecba9d6c79",
"fft_killer_04.out": "cdc542550a1269265a5a458e6064b967b5cd5eb58eee73b8d343cb36b353bc19",
"fft_killer_05.in": "e88f5ecf89090d08f42406540963b70adf7fea797ba12c257e1ce72963822776",
"fft_killer_05.out": "b12d15bc720a8f22caa27aab4c37cf8ddf2a7f7f24d39b329fc8ba9f0c1828b4",
"fft_killer_06.in": "5f3d077cb8c3ba26cd34c438575078512966016d30fdd11998f7fece20bf6003",
"fft_killer_06.out": "51121001326fdc152a2d21c120c7c73cec65cf008a2c16d0b7ffcfac74794834",
"fft_killer_07.in": "b66807d97911c4e619ad177245ed38e8e108a77a2ad4c788f5cc9dcae0550fcb",
"fft_killer_07.out": "653122094277e1d4a8369d8d4db3b0ad272ba34058dc15ea62a7a36fd810af2f",
"max_ans_zero_00.in": "19a7e956c3fa1f281098e0f5af73cd48528c967dc05654a6944bc5d7a946e582",
"max_ans_zero_00.out": "72125c492cd92511e37f17f0257dd9e4627ae18a690f09a231ad38884c50d5be",
"max_random_00.in": "a90a1d4737effb3caaf72184a18cb3e76d28f86e91cb0a0a76dee43a54aa6092",
Expand Down
2 changes: 1 addition & 1 deletion convolution/convolution_mod_large/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/720"
number = 2
[[tests]]
name = "fft_killer.cpp"
number = 4
number = 8
[[tests]]
name = "medium_all_zero.cpp"
number = 3
Expand Down
6 changes: 3 additions & 3 deletions polynomial/polynomial_taylor_shift/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ int main(int, char *argv[])
{
long long seed = atoll(argv[1]);
auto gen = Random(seed);
auto sub = seed % 2 ? 1000 : 10;
auto div = seed % 2 ? 1 : 2;
auto sub = (seed & 1) ? 1000 : 10;
auto div = (seed & 2) ? 1 : 2;

int n = N_MAX;
vector<int> a(n);
constexpr int B = 1 << 15;
const int B = (seed & 4) ? 1<<15 : std::sqrt(MOD);
for (int i = 0; i < n; i++)
{
int lw = gen.uniform(B - sub, B - 1);
Expand Down
24 changes: 16 additions & 8 deletions polynomial/polynomial_taylor_shift/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@
"example_00.out": "e6d731dd19de9b66275d79eee3884c6c4f261081c18b1d4b030dbe014ecd6017",
"example_01.in": "95582d519db66051efd253c7a783b64624e39ae9a6cfedab99ecf1a4504b930a",
"example_01.out": "674a889917679078d14ffb4d4a69d06bba96825963a311c57880d2dfbb07fc9c",
"fft_killer_00.in": "c0e695eb5a0219bc32b71f088b563f4a0cca5d956a1b9c60b8d75bd9bdc7cecb",
"fft_killer_00.out": "8546835a456bd411df6355ab911728d37f0720ec487bc4e531cbf6581b3e8355",
"fft_killer_01.in": "40891215d37aa07b294008b82d4621f20c2ceba057ac3bd8e1294371342176ed",
"fft_killer_01.out": "98cf9162b1d2aa6c8dc6c0b5bc9e1777f084d6e74351b4f88732cd3bc2838dd9",
"fft_killer_02.in": "6468b9b0dbb3b06be5612dd6fb6872e8a972519cdf37fa447c64c2b1544d5752",
"fft_killer_02.out": "303b6d10cee6112e89d6f48f188c3eaf8089e342e8e3a163525033ea8ff2cd72",
"fft_killer_03.in": "c16d83706da13cda43311a31b350cc4dcef02611512b261779c28b469484e8a4",
"fft_killer_03.out": "b9efe963db8311dec0d06f60458b98fc4513970da58102cb8ecbde144b274b98",
"fft_killer_00.in": "f890ec8eb4d062aa1ac583b3bc12fd615df76f1f2978e126772eb815a433a420",
"fft_killer_00.out": "f483e155825d863f7336d1e89363ca662fe7c63baa2a965d66558bb0252db8d1",
"fft_killer_01.in": "2415a653aad2dc1ea918a84ce9666a49e4dec06efa0acc169ba935aa0eacd42c",
"fft_killer_01.out": "544eef07e1c0400e1a00a29fc3b3806a6afe15300b7e79c98e4a1ef0c634d3fe",
"fft_killer_02.in": "fc670b64a5ce3a3692a6bc4fe66d912fecbbca1bcf99545dc65a6cb762157cca",
"fft_killer_02.out": "a4f28f9ea04a49fadcb430d67a0e9d9a0c7f74dd4f655cc0871665b271376ec7",
"fft_killer_03.in": "39d40aa5b510d8aff5544d33c572183280dbb62d4f3cbee459d9b5e6a17c8914",
"fft_killer_03.out": "b2434242cda80a20e5e66d096f2d4f6e30c0a3d1b2a70f8f6e28f0fc4fae62c2",
"fft_killer_04.in": "3367309e33a7e67a1afadb210ffd7bebc9972a1d6fd793af32046209ea6328c8",
"fft_killer_04.out": "c54afcd1d3022159a02e98a4b791ff09bf7db2f6f0b91efbdbcd7a9acb92dfaf",
"fft_killer_05.in": "4e6b466d1fdd846e528c6339d7f66056b5d04e796c57eb4487a583b3918443c2",
"fft_killer_05.out": "8016ccb3955b68233706f718a0e168de12e3e2021ea38f15cc79c4192387ed1f",
"fft_killer_06.in": "73952b69ce8ee6cd536b360617a1c6f92e15a0d173f8f85cb89cd74b1a0e1757",
"fft_killer_06.out": "a7a4d9bacac8b51b2a1031b958cea2610d68de07c2b670b6e7ec4582bc85efbb",
"fft_killer_07.in": "331de90a9907dfddf056f6f1b79d407d2d3612edd81d991099c3df544ef94cf3",
"fft_killer_07.out": "027b3d2a2004adce08fd37d025174de5b1cc346727f40835681b0d6fd012a349",
"max_random_00.in": "ff5f733d78186d7592779ef5635863e86b305d3df77384ac3cda7eca84b27e32",
"max_random_00.out": "1db2c633136ee617f67bcd74cc2c137ebd534094c9ed29518f3ff60cfa00f22f",
"max_random_01.in": "cf1a81808547dff71414f5a07c438302e0bbb86ced97b81f29751b34b1058654",
Expand Down
2 changes: 1 addition & 1 deletion polynomial/polynomial_taylor_shift/info.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ forum = "https://github.com/yosupo06/library-checker-problems/issues/392"
number = 2
[[tests]]
name = "fft_killer.cpp"
number = 4
number = 8
[[tests]]
name = "medium_all_zero.cpp"
number = 1
Expand Down

0 comments on commit 620cc13

Please sign in to comment.