Skip to content

Commit

Permalink
include
Browse files Browse the repository at this point in the history
  • Loading branch information
maspypy committed Jun 2, 2024
1 parent 27a46f6 commit bdbeca4
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 73 deletions.
28 changes: 14 additions & 14 deletions math/discrete_logarithm_mod/gen/even_mod.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

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;
}
28 changes: 14 additions & 14 deletions math/discrete_logarithm_mod/gen/even_mod_impossible.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

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;
}
28 changes: 14 additions & 14 deletions math/discrete_logarithm_mod/gen/max_random.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

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;
}
3 changes: 2 additions & 1 deletion math/discrete_logarithm_mod/gen/max_random_yes.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

using namespace std;
using ll = long long;
Expand Down
3 changes: 2 additions & 1 deletion math/discrete_logarithm_mod/gen/max_random_yes_prime.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

using namespace std;
using ll = long long;
Expand Down
28 changes: 14 additions & 14 deletions math/discrete_logarithm_mod/gen/random.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

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;
}
3 changes: 2 additions & 1 deletion math/discrete_logarithm_mod/gen/random_prime.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

using namespace std;
using ll = long long;
Expand Down
28 changes: 14 additions & 14 deletions math/discrete_logarithm_mod/gen/small.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
#include <cstdlib>
#include <cstdio>
#include "random.h"
#include <iostream>

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;
}

0 comments on commit bdbeca4

Please sign in to comment.