1 solutions

  • 1
    @ 2026-8-27 16:29:46
    #include<bits/stdc++.h>
    using namespace std;
    int A,B;
    int main(){
    	cin>>A>>B;
    	int cnt=0;
    	for(int i=1;i<=2;i++){
    		if(A>B){
    			cnt+=A;
    			A--;
    		}else if(A<B){
    			cnt+=B;
    			B--;
    		}else{
    			cnt+=A;
    			A--;
    		}
    	}
    	cout<<cnt;
    	return 0;
    }
    
    
    • 1

    Information

    ID
    2107
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    1
    Tags
    (None)
    # Submissions
    31
    Accepted
    17
    Uploaded By