diff options
Diffstat (limited to 'normal_distribution.cpp')
| -rw-r--r-- | normal_distribution.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
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 <algorithm> +#include <cassert> #include <cstdio> #include <random> #include <set> @@ -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 |
