T1.报数
这题没什么好说的,就是暴力筛,筛就完了。但是这题需要惊人的胆识(1s跑1e7的量也敢写),所以本蒟蒻只拿了50pts。代码如下:
#include<iostream>
#include<cstdio>
using namespace std;
const int N=1e7+1005;
bool st[N];
int ans[N];
bool check(int x){
while(x){
if(x%10==7) return true;
x/=10;
}
return false;
}
void init(){
for(int i=1;i<=10001000;i++){
if(check(i)){
for(int j=1;j*i<=10001000;j++){
st[j*i]=true;
}
}
}
int back=0;
for(int i=10001000;i>=1;i--){
if(!st[i])