nefu 117 素数分布 http://acm.nefu.edu.cn/test/problemshow.php?problem_id=117
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
int n;
while(cin>>n)
{
int result;
result=n-log10(n*log(10));
cout<<result+1<<endl;
}
}
利用素数定理 pi(x) 近似于 x/ln(x);
浙公网安备 33010602011771号