From 985dfaf9f1b541b51e020561ccc9b91d9c982510 Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Tue, 21 Jun 2022 07:55:51 +0800 Subject: feat(script): Optimize normal distribution generator * feat(script): Finish experiment 1 and 2 Signed-off-by: KunoiSayami --- normal_distribution.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'normal_distribution.cpp') diff --git a/normal_distribution.cpp b/normal_distribution.cpp index fd52ac1..c320ce4 100644 --- a/normal_distribution.cpp +++ b/normal_distribution.cpp @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -22,13 +23,13 @@ int main() { while (set.size() != length) { auto element = (long long)std::round(normalDistribution(randomEngine)); auto ret = set.insert(element); - if (ret.second) + if (ret.second) { vector.push_back(element); + printf("%lld\n", element); + } } - for (long long element : vector) { - printf("%lld\n", element); - } + assert(vector.size() == length); return 0; } \ No newline at end of file -- cgit v1.3.1