3 solutions

  • 1
    @ 2026-6-27 16:35:42
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	char a[1001],b[1001];//我
    	cin>>a>>b;
    	int lena=strlen(a),lenb=strlen(b);//是
    	if(lena<lenb||lena==lenb&&strcmp(a,b)<0){
    		cout<<"YES";//水
    	}else{
    		cout<<"NO";//印
    	}
    	return 0;
    }
    
    • 0
      @ 2025-12-19 20:07:18

      菜鸟请注意,以下是作弊方法:

      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          cout<<"YES";
      }
      
      • 0
        @ 2025-12-19 20:05:22

        正常方法:

        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
            char a[2001]={},b[2001]={};
            cin>>a>>b;
            if(strlen(a)<strlen(b))cout<<"YES";
            else 
            {
                bool c=0;
                for(int i=0;i<strlen(a);i++)if(b[i]>a[i])c=1;
                if(c)cout<<"YES";
                else cout<<"NO";
            }
        }
        
        • 1

        Information

        ID
        1790
        Time
        1000ms
        Memory
        256MiB
        Difficulty
        7
        Tags
        # Submissions
        69
        Accepted
        16
        Uploaded By