比赛 初一开训小练习 评测结果 AAAAAAAAAA
题目名称 01数字 最终得分 100
用户昵称 星辰流浪 运行时间 0.030 s
代码语言 C++ 内存使用 3.64 MiB
提交时间 2026-03-10 19:34:00
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;

int main(){
    freopen("torch.in","r",stdin);
    freopen("torch.out","w",stdout);
    int n;
    cin >> n;
    for(int i=1;i<=30000;i++){
        int temp = n*i;
        bool d = true;
        while(temp){
            int s = temp%10;
            if(s!=0&&s!=1){
                d = false;
                break;
            }
            temp/=10;
        }
        if(d==true){
            cout << i;
            return 0;
        }
        else {
            continue;
        }
    }
    cout << "NO";
    return 0;
}