Patrick and Shopping】的更多相关文章

A. Patrick and Shopping Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/599/problem/A Description Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two…
Patrick and Shopping 今天 Patrick 等待着他的朋友 Spongebob 来他家玩.为了迎接 Spongebob,Patrick 需要去他家附近的两家商店  买一些吃的.他家离第一家商店有d1米远,离第二家商店有d2米远.还有,两家商店之间的距离是d3,帮Patrick计算去两家商店然后回家的最短距离. Patrick 永远从他家出发,他不介意重复经过同一个地点或者同一条路,唯一的目标就是:最小化经过两间商店然后回家的距离. Input 第一行的输入包括三个整数 d1,…
A. Patrick and Shopping   Today Patrick waits for a visit from his friend Spongebob. To prepare for the visit, Patrick needs to buy some goodies in two stores located near his house. There is a d1 meter long road between his house and the first shop…
水题.每种情况取最小值即可. #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);…
傻逼题,但是我还是wa了一发. #include <iostream> using namespace std; int main() { long long a,b,c,Ans=0x7fffffff; cin >> a >> b >> c; Ans=min(Ans,a+a+b+b); Ans=min(Ans,a+c+b); Ans=min(Ans,a+c+c+a); Ans=min(Ans,b+c+c+b); cout << Ans <&…
水 A - Patrick and Shopping #include <bits/stdc++.h> using namespace std; int main(void) { int d1, d2, d3; scanf ("%d%d%d", &d1, &d2, &d3); printf ("%d\n", min (min (2 * (min (d1, d2) + d3), 2 * (d1 + d2)), d1 + d2 + d…
Shopping Time Limit: 1000MS Memory limit: 65536K 题目描述 Saya and Kudo go shopping together.You can assume the street as a straight line, while the shops are some points on the line.They park their car at the leftmost shop, visit all the shops from left…
Description  meter long road between his house and the first shop and a d2 meter long road between his house and the second shop. Also, there is a road of length d3 directly connecting these two shops to each other. Help Patrick calculate the minimum…
http://acm.sdut.edu.cn/sdutoj/problem.php?action=showproblem&problemid=2154 Shopping Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Saya and Kudo go shopping together.You can assume the street as a straight line, while the shops are some…
Shopping Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 632 Accepted Submission(s): 209 Problem Description You have just moved into a new apartment and have a long list of items you need to buy…