From bdbeca4f5f91e0903ec7e4e5de3f62822fcd41f3 Mon Sep 17 00:00:00 2001 From: maspypy Date: Sun, 2 Jun 2024 20:43:45 +0900 Subject: [PATCH] include --- math/discrete_logarithm_mod/gen/even_mod.cpp | 28 +++++++++---------- .../gen/even_mod_impossible.cpp | 28 +++++++++---------- .../discrete_logarithm_mod/gen/max_random.cpp | 28 +++++++++---------- .../gen/max_random_yes.cpp | 3 +- .../gen/max_random_yes_prime.cpp | 3 +- math/discrete_logarithm_mod/gen/random.cpp | 28 +++++++++---------- .../gen/random_prime.cpp | 3 +- math/discrete_logarithm_mod/gen/small.cpp | 28 +++++++++---------- 8 files changed, 76 insertions(+), 73 deletions(-) diff --git a/math/discrete_logarithm_mod/gen/even_mod.cpp b/math/discrete_logarithm_mod/gen/even_mod.cpp index 4824e3074..aca71df2c 100644 --- a/math/discrete_logarithm_mod/gen/even_mod.cpp +++ b/math/discrete_logarithm_mod/gen/even_mod.cpp @@ -1,22 +1,22 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); - long long seed = atoll(argv[1]); - auto gen = Random(seed); - - int t = 100; - printf("%d\n", t); - for (int i = 0; i < t; i++) { - int x, y, m; - m = gen.uniform(800'000'000 / 2, 1'000'000'000 / 2) * 2; - x = gen.uniform(0, m - 1); - y = gen.uniform(0, m - 1); - printf("%d %d %d\n", x, y, m); - } - return 0; + int t = 100; + printf("%d\n", t); + for (int i = 0; i < t; i++) { + int x, y, m; + m = gen.uniform(800'000'000 / 2, 1'000'000'000 / 2) * 2; + x = gen.uniform(0, m - 1); + y = gen.uniform(0, m - 1); + printf("%d %d %d\n", x, y, m); + } + return 0; } diff --git a/math/discrete_logarithm_mod/gen/even_mod_impossible.cpp b/math/discrete_logarithm_mod/gen/even_mod_impossible.cpp index 857dea500..d46cdfc4f 100644 --- a/math/discrete_logarithm_mod/gen/even_mod_impossible.cpp +++ b/math/discrete_logarithm_mod/gen/even_mod_impossible.cpp @@ -1,22 +1,22 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); - long long seed = atoll(argv[1]); - auto gen = Random(seed); - - int t = 100; - printf("%d\n", t); - for (int i = 0; i < t; i++) { - int x, y, m; - m = gen.uniform(800'000'000 / 2, 1'000'000'000 / 2) * 2; - x = gen.uniform(0, m / 2 - 1) * 2; - y = gen.uniform(0, m / 2 - 1) * 2 + 1; - printf("%d %d %d\n", x, y, m); - } - return 0; + int t = 100; + printf("%d\n", t); + for (int i = 0; i < t; i++) { + int x, y, m; + m = gen.uniform(800'000'000 / 2, 1'000'000'000 / 2) * 2; + x = gen.uniform(0, m / 2 - 1) * 2; + y = gen.uniform(0, m / 2 - 1) * 2 + 1; + printf("%d %d %d\n", x, y, m); + } + return 0; } diff --git a/math/discrete_logarithm_mod/gen/max_random.cpp b/math/discrete_logarithm_mod/gen/max_random.cpp index c803b8993..35c81734f 100644 --- a/math/discrete_logarithm_mod/gen/max_random.cpp +++ b/math/discrete_logarithm_mod/gen/max_random.cpp @@ -1,22 +1,22 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); - long long seed = atoll(argv[1]); - auto gen = Random(seed); - - int t = 100; - printf("%d\n", t); - for (int i = 0; i < t; i++) { - int x, y, m; - m = gen.uniform(800'000'000, 1'000'000'000); - x = gen.uniform(0, m - 1); - y = gen.uniform(0, m - 1); - printf("%d %d %d\n", x, y, m); - } - return 0; + int t = 100; + printf("%d\n", t); + for (int i = 0; i < t; i++) { + int x, y, m; + m = gen.uniform(800'000'000, 1'000'000'000); + x = gen.uniform(0, m - 1); + y = gen.uniform(0, m - 1); + printf("%d %d %d\n", x, y, m); + } + return 0; } diff --git a/math/discrete_logarithm_mod/gen/max_random_yes.cpp b/math/discrete_logarithm_mod/gen/max_random_yes.cpp index a9349c590..7c1a272b8 100644 --- a/math/discrete_logarithm_mod/gen/max_random_yes.cpp +++ b/math/discrete_logarithm_mod/gen/max_random_yes.cpp @@ -1,5 +1,6 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; diff --git a/math/discrete_logarithm_mod/gen/max_random_yes_prime.cpp b/math/discrete_logarithm_mod/gen/max_random_yes_prime.cpp index 2fa7236c3..199f64cb9 100644 --- a/math/discrete_logarithm_mod/gen/max_random_yes_prime.cpp +++ b/math/discrete_logarithm_mod/gen/max_random_yes_prime.cpp @@ -1,5 +1,6 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; diff --git a/math/discrete_logarithm_mod/gen/random.cpp b/math/discrete_logarithm_mod/gen/random.cpp index 8bdceddef..a63071428 100644 --- a/math/discrete_logarithm_mod/gen/random.cpp +++ b/math/discrete_logarithm_mod/gen/random.cpp @@ -1,22 +1,22 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); - long long seed = atoll(argv[1]); - auto gen = Random(seed); - - int t = gen.uniform(1, 100); - printf("%d\n", t); - for (int i = 0; i < t; i++) { - int x, y, m; - m = gen.uniform(1, 1'000'000'000); - x = gen.uniform(0, m - 1); - y = gen.uniform(0, m - 1); - printf("%d %d %d\n", x, y, m); - } - return 0; + int t = gen.uniform(1, 100); + printf("%d\n", t); + for (int i = 0; i < t; i++) { + int x, y, m; + m = gen.uniform(1, 1'000'000'000); + x = gen.uniform(0, m - 1); + y = gen.uniform(0, m - 1); + printf("%d %d %d\n", x, y, m); + } + return 0; } diff --git a/math/discrete_logarithm_mod/gen/random_prime.cpp b/math/discrete_logarithm_mod/gen/random_prime.cpp index a7b901e5c..1d14c3793 100644 --- a/math/discrete_logarithm_mod/gen/random_prime.cpp +++ b/math/discrete_logarithm_mod/gen/random_prime.cpp @@ -1,5 +1,6 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; diff --git a/math/discrete_logarithm_mod/gen/small.cpp b/math/discrete_logarithm_mod/gen/small.cpp index 61a2e21b1..d2a19c38d 100644 --- a/math/discrete_logarithm_mod/gen/small.cpp +++ b/math/discrete_logarithm_mod/gen/small.cpp @@ -1,22 +1,22 @@ +#include +#include #include "random.h" -#include using namespace std; using ll = long long; int main(int, char* argv[]) { + long long seed = atoll(argv[1]); + auto gen = Random(seed); - long long seed = atoll(argv[1]); - auto gen = Random(seed); - - int t = 100; - printf("%d\n", t); - for (int i = 0; i < t; i++) { - int x, y, m; - m = gen.uniform(1, 10); - x = gen.uniform(0, m - 1); - y = gen.uniform(0, m - 1); - printf("%d %d %d\n", x, y, m); - } - return 0; + int t = 100; + printf("%d\n", t); + for (int i = 0; i < t; i++) { + int x, y, m; + m = gen.uniform(1, 10); + x = gen.uniform(0, m - 1); + y = gen.uniform(0, m - 1); + printf("%d %d %d\n", x, y, m); + } + return 0; }