超简洁,但只有40分,求调
查看原帖
超简洁,但只有40分,求调
1192662
whrr楼主2024/10/20 12:52
#include<iostream>
#include<algorithm>
using namespace std;

long long n,high,low;

int main(){
    cin>>n;
    while(n--){
        long long a,b,c,d;
        cin>>a>>b;
        c = max((a - b),b);
        if(high<c) high = c;
        else{
            if(low<c) low = c;
        }

    }
    cout<<high + low;
    return 0;
}
2024/10/20 12:52
加载中...