Anaprimes: Difference between revisions
m
C++ - simplified code
m (→{{header|Phix}}: changed <= to < so it now shows the first rather than last group found) |
m (C++ - simplified code) |
||
Line 35:
{{libheader|Primesieve}}
This takes about 70 seconds on my system. Memory usage is 4G.
<syntaxhighlight lang="cpp">#include <
#include <iostream>
#include <map>
Line 43 ⟶ 42:
#include <primesieve.hpp>
for (; n > 0; n /= 10)▼
++count_[n % 10];▼
digit_set get_digits(uint64_t n) {
};▼
return result;
int main() {
std::cout.imbue(std::locale(""));
primesieve::iterator pi;
using map_type =
std::map<digit_set, std::vector<uint64_t>, std::greater<digit_set>>;
map_type anaprimes;
for (uint64_t limit = 1000; limit <= 10000000000;) {
Line 90 ⟶ 80:
limit *= 10;
}
anaprimes[
}
}</syntaxhighlight>
|