傻逼题,但是我还是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 <&…
水题.每种情况取最小值即可. #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);…
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…
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…
Maxim wants to buy some games at the local game shop. There are n games in the shop, the i-th game costs ci. Maxim has a wallet which can be represented as an array of integers. His wallet contains m bills, the j-th bill has value aj. Games in the sh…
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... 其实这个应该是昨天就写完的,不过没时间了,就留到了今天.. 地址:http://codeforces.com/contest/651/problem/A A. Joysticks time limit per test 1 second memory limit per test 256…
CF memsql Start[c]UP 2.0 A A. Golden System time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Piegirl got bored with binary, decimal and other integer based counting systems. Recently she dis…
CF memsql Start[c]UP 2.0 B B. Distributed Join time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Piegirl was asked to implement two table join operation for distributed database system, minim…
E. Sign on Fence time limit per test 4 seconds memory limit per test 256 megabytes input standard input output standard output Bizon the Champion has recently finished painting his wood fence. The fence consists of a sequence of n panels of 1 meter w…
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…
Could not load file or assembly 'MySql.Data.CF, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, Retargetable=Yes' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047 I so…
题目链接: 传送门 Discounts time limit per test:3 second memory limit per test:256 megabytes Description One day Polycarpus stopped by a supermarket on his way home. It turns out that the supermarket is having a special offer for stools. The offer is as…
Freelancer's Dreams time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Mikhail the Freelancer dreams of two things: to become a cool programmer and to buy a flat in Moscow. To become a cool p…
CF 600B 题目大意:给定n,m,数组a(n个数),数组b(m个数),对每一个数组b中的元素,求数组a中小于等于数组该元素的个数. 解题思路:对数组a进行排序,然后对每一个元素b[i],在数组a中进行二分查找第一个大于b[i]的位置即为结果 /* CF 600B Queries about less or equal elements --- 二分查找 */ #include <cstdio> #include <algorithm> using namespace std;…