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