题目链接
题意:给出家到A,B超市的距离,以及超市之间的距离,问去了A,B超市,再回家的最小路径。
解法:枚举四种情况,手残用了inf(初始化不够大= =)
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
#define X first
#define Y second
#define cl(a,b) memset(a,b,sizeof(a))
typedef pair<int,int> P;
const int maxn=300005;
const LL inf=1<<27;
const LL mod=1e9+7;
int main(){
LL a,b,c;
cin>>a>>b>>c;
LL ans=a+b+c;
ans=min(ans,2*(a+b));
ans=min(ans,a+a+c+c);
ans=min(ans,b+b+c+c);
cout<<ans<<endl;
return 0;
}