Legendre prime counting function: Difference between revisions
Removed memoization from C++ solution
GordonBGood (talk | contribs) (→Non-Memoized Version: Nim, adjustments to comments and clarifications...) |
(Removed memoization from C++ solution) |
||
Line 33:
<syntaxhighlight lang="cpp">#include <cmath>
#include <iostream>
#include <vector>
Line 62 ⟶ 61:
int phi(int x, int a);
std::vector<int> primes;
};
Line 78 ⟶ 76:
if (a == 0)
return x;
if (x <=
▲ return result;
}
|