Skip to content

Commit

Permalink
Extra MOD / 2 hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
adamant-pwn committed Nov 21, 2024
1 parent f8c0f71 commit 744d0da
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 23 deletions.
5 changes: 3 additions & 2 deletions convolution/convolution_mod/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ 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;

int n = N_AND_M_MAX;
int m = N_AND_M_MAX;
vector<int> a(n), b(m);
constexpr int B = 1<<15;
for (int i = 0; i < n; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
a[i] = up * B + lw;
}
for (int i = 0; i < m; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
b[i] = up * B + lw;
}

Expand Down
8 changes: 4 additions & 4 deletions convolution/convolution_mod/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"example_00.out": "bed182fa28059c3a153ceb69a5293edb94f3984e7df500c7d5b0deb991bedfe4",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "6f3fe32c2ab1bc6522fb407ec92377205c8c6c17e457f4d50cda2c0f0764cf61",
"fft_killer_00.in": "aa7818a4ce38431767e6b7c45e69cffcdc76e71dfa2de2116e467f6949239dd4",
"fft_killer_00.out": "7474929ea18c0716de6efe9f516bb08b7075860126487b37abea68e59c0df6f3",
"fft_killer_00.in": "89539236b90b3150196b177ee5373aca791362f37474e7c41fa32b8bd91fed5f",
"fft_killer_00.out": "00fbc3b7d34228f9091d6644065643acc5b2e59f59ded12d071755fc4c33e922",
"fft_killer_01.in": "a624e97bd32fbb1a2f76534f29072b8ef97cb1cc32e2e30c43d61ecb57d450db",
"fft_killer_01.out": "64b26ddc3943011647852260b5b41c805cddb8981d38785a95fedce3dcf379c4",
"fft_killer_02.in": "c3ede6208ab7e8593b6682a3b1d842e8b2a034a604267cc6aa7e3fff9aea3865",
"fft_killer_02.out": "2d906c9d68dee9a0a73ead820e562cd68a57034f38d734be0ff57254b97e3cf4",
"fft_killer_02.in": "76a6a4d3e9c68b962e1f1492617b9215d87a03cb94ac2fd947d815e173c4f540",
"fft_killer_02.out": "0ba591e33d2480a7cc6d0d619e2896e13d08f17d4af669c2c880d75b8d53b802",
"fft_killer_03.in": "0582b443660597cfe426bb3b9aeb1ff0caefded993542b3dbd1ec2063a0c422f",
"fft_killer_03.out": "a5c7bf7d0318d8dbe52fc37b0991e996f36bdc2ec528c4c8cbbd8bfc6cac87c7",
"max_ans_zero_00.in": "45932122a32f92e6a87b35cd980553a17082807a7f54c5594c92de911f88e181",
Expand Down
5 changes: 3 additions & 2 deletions convolution/convolution_mod_1000000007/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ 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;

int n = N_AND_M_MAX;
int m = N_AND_M_MAX;
vector<int> a(n), b(m);
constexpr int B = 1<<15;
for (int i = 0; i < n; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
a[i] = up * B + lw;
}
for (int i = 0; i < m; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
b[i] = up * B + lw;
}

Expand Down
8 changes: 4 additions & 4 deletions convolution/convolution_mod_1000000007/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"example_00.out": "bed182fa28059c3a153ceb69a5293edb94f3984e7df500c7d5b0deb991bedfe4",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "e02b7be488d77085ccc6ca2b616fb26d0148b42d1fd998229f89651f7922a2ed",
"fft_killer_00.in": "70b7b34c884049daef9d36a468eb7acac2b73de6de424880d382b8aac4461808",
"fft_killer_00.out": "b568af427a13f73cc2c93bc916d25961faa38b715bcc228f2829d7a163bf6171",
"fft_killer_00.in": "06796d23dedc96bd6e7d51683560025fde7cd8c0e5619f209095f5ad54a12265",
"fft_killer_00.out": "29692271314d1a8f082ff66bcd1a00b55522519c2868c2903b2f6cb864a0aafc",
"fft_killer_01.in": "ad873a6f5d5657d270160f8ffe65d9abd56f41adf4cffdc86202136430e42f35",
"fft_killer_01.out": "76826553c1c8b3ddb37cd04b15348e4b5e0a7360eb4c2eea4be06b3e2668e482",
"fft_killer_02.in": "e587d3eed7d03cb9320ea6cba8f7a4a4e9bec18ac9452e5ab57a350f037cda06",
"fft_killer_02.out": "fa0b0074e44f118df6176d38b104df221090b7894e18a58a458c960b1975d128",
"fft_killer_02.in": "b21681739b9720e5569221803f65772258081da7c51a2f8c92692105fb87cddf",
"fft_killer_02.out": "fb5a42af4ea2d58d08e97ddbff776df1cd1f4d6fe709e4d180b95c016346b450",
"fft_killer_03.in": "b065127d09d03c774b1e38b518c440d4c2f0137d5577e518d99c439b39f4c08f",
"fft_killer_03.out": "8b55a81cb21c7edba008a1a15d9220ce4d4f40a94b1f99c2c4a7c1cba8c688e8",
"max_ans_zero_00.in": "fdf42aae02c3335ed46b91a0c98bb6ebf4e468110ce13deebc06fb3eede67bf9",
Expand Down
5 changes: 3 additions & 2 deletions convolution/convolution_mod_large/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ 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;

int n = N_AND_M_MAX;
int m = N_AND_M_MAX;
vector<int> a(n), b(m);
constexpr int B = 1 << 15;
for (int i = 0; i < n; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
a[i] = up * B + lw;
}
for (int i = 0; i < m; i++) {
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
b[i] = up * B + lw;
}

Expand Down
8 changes: 4 additions & 4 deletions convolution/convolution_mod_large/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"example_00.out": "bed182fa28059c3a153ceb69a5293edb94f3984e7df500c7d5b0deb991bedfe4",
"example_01.in": "cb82ca85c390fabfd1c38aa4d97d76071db8fb8ba0e70ba6179f525564e40cd1",
"example_01.out": "6f3fe32c2ab1bc6522fb407ec92377205c8c6c17e457f4d50cda2c0f0764cf61",
"fft_killer_00.in": "9e40a2ef096b4bd6fc74e76fd7fcaab722b653b5e6336a0e2e418b2477fc9801",
"fft_killer_00.out": "1e7ab6098eabe540ce12f2292e7301e44158238e4252d496a047af48d796bed9",
"fft_killer_00.in": "4094e9e44fa65cfb96ab58726f44c4607ac8640baf5f25a758a44fcf64fd2817",
"fft_killer_00.out": "c80639dcf2b1780ae26e792ff17dcb92dbf609a6e45b7d7500322cbcf6b9dc7a",
"fft_killer_01.in": "0a1c1a4baf06a0faddcddc2e455238037aeae65e317eb57f86c39b825c5bfddf",
"fft_killer_01.out": "1c15ba7aae24821fcf18539d477e877dfa423cd286b351a4af15042d0466a8df",
"fft_killer_02.in": "9cc03e0c6ea5ec2a97f28eb4671cf2548587a529362046d1fdb1ca5f932338de",
"fft_killer_02.out": "b9abcd6e0448ac044a0e73f0c505a2c7235a556403e5a14e07670f93c8d5fe57",
"fft_killer_02.in": "25d9e4429f7d6e66700a46660652f1c86fac194e54b18b4fbc923fb2038c8801",
"fft_killer_02.out": "180f4866e3142d932e91d7e21049dd2160fedc4aab619fed4993a0104befffc3",
"fft_killer_03.in": "08445bbeca62e11606d08a6e6066e89cbee74f4ebe979dd87da66cef548e9bb8",
"fft_killer_03.out": "f3f7aedc49ed299217c82d4de9a4edb3ae85878a1a9c6c3acf2af923d3f61755",
"max_ans_zero_00.in": "19a7e956c3fa1f281098e0f5af73cd48528c967dc05654a6944bc5d7a946e582",
Expand Down
3 changes: 2 additions & 1 deletion polynomial/polynomial_taylor_shift/gen/fft_killer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ 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;

int n = N_MAX;
vector<int> a(n);
constexpr int B = 1 << 15;
for (int i = 0; i < n; i++)
{
int lw = gen.uniform(B - sub, B - 1);
int up = gen.uniform(MOD / B - sub, MOD / B - 1);
int up = gen.uniform(MOD / div / B - sub, MOD / div / B - 1);
a[i] = up * B + lw;
}
int c = gen.uniform(0ll, MOD - 1);
Expand Down
8 changes: 4 additions & 4 deletions polynomial/polynomial_taylor_shift/hash.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"example_00.out": "e6d731dd19de9b66275d79eee3884c6c4f261081c18b1d4b030dbe014ecd6017",
"example_01.in": "95582d519db66051efd253c7a783b64624e39ae9a6cfedab99ecf1a4504b930a",
"example_01.out": "674a889917679078d14ffb4d4a69d06bba96825963a311c57880d2dfbb07fc9c",
"fft_killer_00.in": "b96a98f4531681938272f5869e8bef6b142e80914281133fb7ed3635bdf69bed",
"fft_killer_00.out": "3eda949e28201368ab6107bc15bd1f9177d65f300e14324b658fdc8d611c0c99",
"fft_killer_00.in": "c0e695eb5a0219bc32b71f088b563f4a0cca5d956a1b9c60b8d75bd9bdc7cecb",
"fft_killer_00.out": "8546835a456bd411df6355ab911728d37f0720ec487bc4e531cbf6581b3e8355",
"fft_killer_01.in": "40891215d37aa07b294008b82d4621f20c2ceba057ac3bd8e1294371342176ed",
"fft_killer_01.out": "98cf9162b1d2aa6c8dc6c0b5bc9e1777f084d6e74351b4f88732cd3bc2838dd9",
"fft_killer_02.in": "7f852880c3a58acac3014450a5a2959c2d1377cde227bb593023ab38c6f7e3b8",
"fft_killer_02.out": "0cd2f8e68692c331ab1e99d487d76b8ae0bd6fc5f11c5fa5961f2b2f768d3adc",
"fft_killer_02.in": "6468b9b0dbb3b06be5612dd6fb6872e8a972519cdf37fa447c64c2b1544d5752",
"fft_killer_02.out": "303b6d10cee6112e89d6f48f188c3eaf8089e342e8e3a163525033ea8ff2cd72",
"fft_killer_03.in": "c16d83706da13cda43311a31b350cc4dcef02611512b261779c28b469484e8a4",
"fft_killer_03.out": "b9efe963db8311dec0d06f60458b98fc4513970da58102cb8ecbde144b274b98",
"max_random_00.in": "ff5f733d78186d7592779ef5635863e86b305d3df77384ac3cda7eca84b27e32",
Expand Down

0 comments on commit 744d0da

Please sign in to comment.