-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path00033.cpp
More file actions
44 lines (36 loc) · 884 Bytes
/
00033.cpp
File metadata and controls
44 lines (36 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Problem: Eolymp 33 - The favorite numbers of Santa Claus
// Link: https://basecamp.eolymp.com/en/problems/33
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
vector<bool>v(500001,true);
v[0]=v[1]=false;
for(int i=2;i*i<=500000;i++){
if(v[i]){
for(int j=i*i;j<=500000;j+=i){
v[j]=false;
}
}
}
int a,b;
cin>>a>>b;
int say=0;
for(int i=a;i<=b;i++){
if(v[i]){
int f=true;
int istart=i;
while(istart>0){
if(istart%100==13){
f=false;
break;
}
istart=istart/10;
}
if(f){
say++;
}
}
}cout<<say<<endl;}