Codeforces Round #332 (Div. 2)A. Patrick and Shopping(简单题)

原创 2015年11月21日 10:16:26

题目链接
题意:给出家到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;
}
版权声明:一个菜逼的笔记,并没有什么题解。。。

【Codeforces Round 332 (Div 2)A】【水题】A. Patrick and Shopping 遍历三元环的最小成本

A. Patrick and Shopping time limit per test 1 second memory limit per test 256 megabytes...

Codeforces Round #332 (Div. 2) A. Patrick and Shopping

A. Patrick and Shopping time limit per test 1 second memory limit per test 256 megabytes...

【Codeforces Round 332 (Div 2)D】【数学 公式推导】Spongebob and Squares 正方形数量恰好为x个的所有大矩形

D. Spongebob and Squares time limit per test 2 seconds memory limit per test 256 megabyt...

【Codeforces Round 332 (Div 2)B】【扭转题意 位置映射】Spongebob and Joke 给b[]中的每个数找f[]中的位置

B. Spongebob and Joke time limit per test 2 seconds memory limit per test 256 megabytes ...

Codeforces Round #332 (Div. 2) D. Spongebob and Squares详解

Codeforces Round #332 (Div. 2) D. Spongebob and Squares

Codeforces Round #332 (Div. 2)_B. Spongebob and Joke

B. Spongebob and Joke time limit per test 2 seconds memory limit per test 256 megabytes ...

Codeforces Round #332 (Div. 2) D. Spongebob and Squares

Spongebob is already tired trying to reason his weird actions and calculations, so he simply asked y...

Codeforces Round #332 (Div. 2) B. Spongebob and Joke

Codeforces Round #332 (Div. 2) C. Spongebob and Joke Vector

Codeforces Round #257 (Div. 2) A. Jzzhu and Children(简单题)

Codeforces Round #257 (Div. 2) A. Jzzhu and Children(简单题)

Codeforces Round #332 (Div. 2)C. Day at the Beach

C. Day at the Beach time limit per test 2 seconds memory limit per test 256 megabytes ...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:Codeforces Round #332 (Div. 2)A. Patrick and Shopping(简单题)
举报原因:
原因补充:

(最多只允许输入30个字)