This commit is contained in:
James 2020-04-24 22:35:11 +08:00
parent de87f59713
commit 202f947cac
4 changed files with 34 additions and 11 deletions

View File

@ -0,0 +1,22 @@
#include <iostream>
#include <algorithm>
using namespace std;
bool pan[1000001]={0};
int main()
{
int begn, ends;
cin >> begn >> ends;
for (int i = 2; i * i <= ends; i++) {
for(int j=ends/i;i*j>=begn&&j!=1;j--){
pan[i*j-begn]=1;
}
}
int ans=0;
for(int i=0;i<=ends-begn;i++){
if(pan[i]==0){
ans++;
//cout<<begn+i<<" ";
}
}
cout<<ans;
}

Binary file not shown.

View File

@ -0,0 +1 @@
2000000 2009999

View File

@ -1,18 +1,18 @@
## z:\Chao\src\3069_includesushu\test\in.txt
2020/04/19 周日 11:36:55.94
4
2020/04/24 周五 18:49:17.02
5
-----------------------------------------------
Process exited after 220 ms with return value 0
Process exited after 160 ms with return value 0
## z:\Chao\src\3069_includesushu\test\in2.txt
2020/04/19 周日 11:36:55.94
262
2020/04/24 周五 18:49:17.02
69
-----------------------------------------------
Process exited after 80 ms with return value 0
## z:\Chao\src\3069_includesushu\test\in3.txt
2020/04/24 周五 18:49:17.02
705
-----------------------------------------------
Process exited after 90 ms with return value 0
## z:\Chao\src\3069_includesushu\test\in3.txt
2020/04/19 周日 11:36:55.94
-7083472
-----------------------------------------------
Process exited after 70 ms with return value 0