| 比赛 | 2009noip模拟试卷 | 评测结果 | AAAAAAAAAA |
|---|---|---|---|
| 题目名称 | 01数字 | 最终得分 | 100 |
| 用户昵称 | 农场主 | 运行时间 | 0.002 s |
| 代码语言 | C++ | 内存使用 | 0.26 MiB |
| 提交时间 | 2016-10-09 14:12:09 | ||
#include<cstdio>
#include<algorithm>
using namespace std;
bool check(int x){
while(x){
if ((x%10)>1){
return 0;
}
x/=10;
}
return 1;
}
void work(){
int x;
int n=30000;
scanf("%d",&x);
for (int i=1;i<=n;i++){
if (check(i*x)) {
printf("%d",i);
return;
}
}
printf("NO");
}
int main(){
freopen("torch.in","r",stdin);
freopen("torch.out","w",stdout);
work();
return 0;
}