尝试stl
This commit is contained in:
parent
bd2fdb699e
commit
1663be60f3
|
@ -21,7 +21,10 @@
|
||||||
"typeinfo": "cpp",
|
"typeinfo": "cpp",
|
||||||
"deque": "cpp",
|
"deque": "cpp",
|
||||||
"string": "cpp",
|
"string": "cpp",
|
||||||
"vector": "cpp"
|
"vector": "cpp",
|
||||||
|
"unordered_map": "cpp",
|
||||||
|
"unordered_set": "cpp",
|
||||||
|
"string_view": "cpp"
|
||||||
},
|
},
|
||||||
"terminal.integrated.automationShell.windows": "cmd.exe",
|
"terminal.integrated.automationShell.windows": "cmd.exe",
|
||||||
"files.encoding": "gb18030",
|
"files.encoding": "gb18030",
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
|
@ -0,0 +1,7 @@
|
||||||
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
|
using namespace std;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
|
@ -0,0 +1,7 @@
|
||||||
|
## z:\Chao\src\Template\test\in.txt
|
||||||
|
2020/03/14 ÖÜÁù 11:41:28.68
|
||||||
|
Hello Easy C++ project!
|
||||||
|
|
||||||
|
-----------------------------------------------
|
||||||
|
Process exited after 200 ms with return value 0
|
||||||
|
|
Binary file not shown.
|
@ -0,0 +1,23 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include<set>
|
||||||
|
using namespace std;
|
||||||
|
set<int> cun;
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int n,now=1;
|
||||||
|
for(int i=0;now<=1000000000;i++){
|
||||||
|
now+=i;
|
||||||
|
cun.insert(now);
|
||||||
|
}
|
||||||
|
cin>>n;
|
||||||
|
for(int i=1;i<=n;i++){
|
||||||
|
int u;
|
||||||
|
cin>>u;
|
||||||
|
if(cun.find(u)==cun.end()){
|
||||||
|
cout<<"0"<<endl;
|
||||||
|
}else{
|
||||||
|
cout<<"1"<<endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Binary file not shown.
|
@ -1,5 +1,5 @@
|
||||||
## z:\Chao\src\3053_longdui\test\in.txt
|
## z:\Chao\src\3053_longdui\test\in0.txt
|
||||||
2020/04/18 ÖÜÁù 9:50:13.40
|
2020/04/22 ÖÜÈý 19:07:51.69
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
|
@ -102,10 +102,10 @@
|
||||||
0
|
0
|
||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Process exited after 430 ms with return value 0
|
Process exited after 210 ms with return value 0
|
||||||
|
|
||||||
## z:\Chao\src\3053_longdui\test\in2.txt
|
## z:\Chao\src\3053_longdui\test\in2.txt
|
||||||
2020/04/18 ÖÜÁù 9:50:13.40
|
2020/04/22 ÖÜÈý 19:07:51.69
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
|
@ -1108,10 +1108,10 @@ Process exited after 430 ms with return value 0
|
||||||
0
|
0
|
||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Process exited after 220 ms with return value 0
|
Process exited after 130 ms with return value 0
|
||||||
|
|
||||||
## z:\Chao\src\3053_longdui\test\in3.txt
|
## z:\Chao\src\3053_longdui\test\in3.txt
|
||||||
2020/04/18 ÖÜÁù 9:50:13.40
|
2020/04/22 ÖÜÈý 19:07:51.69
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
0
|
0
|
||||||
|
@ -2114,5 +2114,5 @@ Process exited after 220 ms with return value 0
|
||||||
0
|
0
|
||||||
|
|
||||||
-----------------------------------------------
|
-----------------------------------------------
|
||||||
Process exited after 220 ms with return value 0
|
Process exited after 130 ms with return value 0
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 标题
|
||||||
|
|
||||||
|
* 内容
|
Binary file not shown.
|
@ -0,0 +1,36 @@
|
||||||
|
#include <iostream>
|
||||||
|
#include <vector>
|
||||||
|
using namespace std;
|
||||||
|
vector<int> su;
|
||||||
|
bool pan(int n)
|
||||||
|
{
|
||||||
|
if(n==1){
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < su.size(); i++) {
|
||||||
|
if (n % su[i] == 0 || su[i] * su[i] > n) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
su.push_back(n);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int begn, ends;
|
||||||
|
cin >> begn >> ends;
|
||||||
|
int bgnum=1,ednum=1;
|
||||||
|
/*if(pan(begn)==1){
|
||||||
|
bgnum--;
|
||||||
|
}*/
|
||||||
|
for (int i = 2; i * i <= ends; i++) {
|
||||||
|
if (pan(i) == 1) {
|
||||||
|
if (i * i <= begn) {
|
||||||
|
bgnum+=begn/i+i-2;
|
||||||
|
}
|
||||||
|
ednum+=ends/i+i-2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cout<<ends-ednum-begn+bgnum;
|
||||||
|
}
|
Binary file not shown.
|
@ -0,0 +1 @@
|
||||||
|
2 11
|
|
@ -0,0 +1 @@
|
||||||
|
2000000 2000999
|
|
@ -0,0 +1,18 @@
|
||||||
|
## z:\Chao\src\3069_includesushu\test\in.txt
|
||||||
|
2020/04/19 ÖÜÈÕ 11:36:55.94
|
||||||
|
4
|
||||||
|
-----------------------------------------------
|
||||||
|
Process exited after 220 ms with return value 0
|
||||||
|
|
||||||
|
## z:\Chao\src\3069_includesushu\test\in2.txt
|
||||||
|
2020/04/19 ÖÜÈÕ 11:36:55.94
|
||||||
|
262
|
||||||
|
-----------------------------------------------
|
||||||
|
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
|
||||||
|
|
Loading…
Reference in New Issue