3 条题解

  • 0
    @ 2025-6-30 17:36:17

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    #define LL long long
    #define down cout<<"\n";
    #define speed std::ios::sync_with_stdio(false);
    
    const int N=1e5+5;
    
    
    
    int main(){
    	string s;
    	cin>>s;
    	bool flag=1;
    	for(int i=0;i<s.size();i++){
    		if(s[i]!='0' && s[i]!='1'){
    			flag=0;
    		}
    	}
    	if(flag){
    		cout<<"Yes";
    	} else {
    		cout<<"No";
    	}
    	return 0;
    }
    
    

    信息

    ID
    182
    时间
    1000ms
    内存
    128MiB
    难度
    10
    标签
    递交数
    1
    已通过
    1
    上传者