水题。每种情况取最小值即可。

#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std; long long d1,d2,d3; int main()
{
scanf("%lld%lld%lld",&d1,&d2,&d3);
long long X,Y,Z;
X=min(d1,d2+d3);
Y=min(d2,d1+d3);
Z=min(d3,d1+d2);
long long ans=min(*X+*Y,X+Y+Z);
printf("%lld\n",ans);
return ;
}

CodeForces 599A Patrick and Shopping的更多相关文章

  1. [cf 599A]Patrick and Shopping

    傻逼题,但是我还是wa了一发. #include <iostream> using namespace std; int main() { long long a,b,c,Ans=0x7f ...

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

    A. Patrick and Shopping Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...

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

    A. Patrick and Shopping   Today Patrick waits for a visit from his friend Spongebob. To prepare for ...

  4. Patrick and Shopping

    Patrick and Shopping 今天 Patrick 等待着他的朋友 Spongebob 来他家玩.为了迎接 Spongebob,Patrick 需要去他家附近的两家商店  买一些吃的.他家 ...

  5. 【CodeForces 599A】D - 特别水的题4- Patrick and Shopping

    Description  meter long road between his house and the first shop and a d2 meter long road between h ...

  6. Educational Codeforces Round 12 B. Shopping 暴力

    B. Shopping 题目连接: http://www.codeforces.com/contest/665/problem/B Description Ayush is a cashier at ...

  7. Codeforces Round #332 (Div. 2)

    水 A - Patrick and Shopping #include <bits/stdc++.h> using namespace std; int main(void) { int ...

  8. Educational Codeforces Round 47 (Div 2) (A~G)

    目录 Codeforces 1009 A.Game Shopping B.Minimum Ternary String C.Annoying Present D.Relatively Prime Gr ...

  9. Codeforces Gym 100803C Shopping 贪心

    Shopping 题目连接: http://codeforces.com/gym/100803/attachments Description Your friend will enjoy shopp ...

随机推荐

  1. Really simple SSH proxy (SOCKS5)

    原文: https://thomashunter.name/blog/really-simple-ssh-proxy-socks5/ SOCKS5 is a simple, eloquent meth ...

  2. Android(java)学习笔记158:多线程断点下载的原理(JavaSE实现)

    1. 为什么需要多线程下载?     服务器的资源有限,同时的平均地分配给每个客户端.开启的线程越多抢占的服务的资源就越多,下载的速度就越块. 2. 下载速度的限制条件? (1)你的电脑手机宽带的带宽 ...

  3. uva1615 Highway

    画图,每个给出点都有对应区间:先sort,再尽量靠右选:很常见的套路了..//注意不要越界(0,L) struct Q //复习结构{ double l,r; Q(double _l,double _ ...

  4. com组件简单应用

    1.打开VS2010,新建ATL COM 项目,步骤:“文件” -->“新建” -->“项目”,选择“Visual C++” -->“ATL 项目” ,填写“名称” FirstCOM ...

  5. C-基础:数组名与取地址符&

    指出下面代码的输出,并解释为什么.(不错,对地址掌握的深入挖潜) main() { ]={,,,,}; ); printf(),*(ptr-)); } 输出:2,5     *(a+1)就是a[1], ...

  6. Qt _六天的学习路线

    六天的学习路线:第一天:    1.Qt的介绍    2.Qt的框架    3.项目文件(.pro)    4.第一个Qt程序(hello Qt)    5.父窗口和子窗口的区别(控件,部件,构件)  ...

  7. VIO第二讲_allen方差工具

    1,首先,安装ceres依赖项,见高博14讲116页,然后下载编译安装ceres: git clone https://github.com/ceres-solver/ceres-solver cd ...

  8. CentOS7.6 静态IP配置

    1:选中安装好的虚拟机,点击“编辑”,然后选择“虚拟网络编辑器(N…)”,如下图所示: 2:选择桥接模式,在桥接到指定的本地网卡即可."确定"保存 3:选中虚拟机,右击虚拟机,选择 ...

  9. 【EL&JSTL】学习笔记

    一.EL表达式(形式:${ }) 1. 1 EL运算符 算术运算符: +.-.*./.% 示例 结果 ${1+1} 2 ${1-1} 0 ${1*3} 3 ${3/2} 1.5 ${5%3} 2 关系 ...

  10. tornado框架基础02-输入和输出

    01 输出 write bytes类型 class IndexHandler(tornado.web.RequestHandler): def get(self): self.write(b'Torn ...