2 solutions

  • 1
    @ 2025-8-20 19:26:18
    #include<bits/stdc++.h>
    using namespace std;
    int main(){
    	int a,b;cin>>a>>b;
    	if(a==1 and b==10 or a==10 and b==1) cout<<"Yes";
    	else{
    		if (abs(a-b)==1) cout<<"Yes";
    		else cout<<"No";
    	}
    	return 0;
    }
    
    
    

    Information

    ID
    2326
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    91
    Accepted
    32
    Uploaded By