比赛 初一开训小练习 评测结果 AAAAAAAAAA
题目名称 01数字 最终得分 100
用户昵称 运行时间 0.029 s
代码语言 C++ 内存使用 3.70 MiB
提交时间 2026-03-10 19:25:48
显示代码纯文本
#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("torch.in","r",stdin);
    freopen("torch.out","w",stdout);
    int n;
    cin>>n;
    bool p=1;
    for(int i=1;i<=30000;i++){
        int a=n*i;
        bool r=1;
        while(a!=0){
            int g=a%10;
            a/=10;
            if(g!=0 && g!=1){
                r=0;
                break;
            }
        }
        if(r){
            p=0;
           cout<<i;
           break; 
        }
    }
    if(p){
        cout<<"NO";
    }
    return 0;
}