Description 读入一个只包含 +, -, *, / 的非负整数计算表达式,计算该表达式的值.    Input 测试输入包含若干测试用例,每个测试用例占一行,每行不超过200个字符,整数和运算符之间用一个空格分隔.没有非法表达式.当一行中只有0时输入结束,相应的结果不要输出.    Output 对每个测试用例输出1行,即该表达式的值,精确到小数点后2位.    Sample Input 1 + 2 4 + 2 * 5 - 7 / 11 0   Sample Output 3.00 1…
Description The GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one large rectangular region of land at a time, and creates a grid that divides the land into numerous square plots. It…
题目链接:http://acm.hust.edu.cn/vjudge/contest/121192#problem/G 此题大意是给定一个数n 然后有n个数 要求求出其中位数  刚开始以为是按数学中的中位数当n为偶数时输出中间两位数之和再除以2    这题是只要先排序再输出第n/2个数即可 ac代码: import java.io.BufferedInputStream; import java.util.Arrays; import java.util.Scanner; public clas…
Description 给出了一个序列,你需要处理如下两种询问. "C a b c"表示给[a, b]区间中的值全部增加c (-10000 ≤ c ≤ 10000). "Q a b" 询问[a, b]区间中所有值的和. Input 第一行包含两个整数N, Q.1 ≤ N,Q ≤ 100000. 第二行包含n个整数,表示初始的序列A (-1000000000 ≤ Ai ≤ 1000000000). 接下来Q行询问,格式如题目描述. Output 对于每一个Q开头的询问…
F                                                                                                                        Find a way Pass a year learning in Hangzhou, yifenfei arrival hometown Ningbo at finally. Leave Ningbo one year, yifenfei have ma…
There is a famous railway station in PopPush City. Country there is incredibly hilly. The station was built in last century. Unfortunately, funds were extremely limited that time. It was possible to establish only a surface track. Moreover, it turned…
B - Catch That Cow Description Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number line and the cow is at a point K (0 ≤ K ≤ 100,000) on the same num…
题目链接:http://acm.hust.edu.cn/vjudge/contest/123674#problem/F 题意:在相通n个岛屿的所有桥都坏了,要重修,重修每一个桥所用的时间不同,求重修使每个岛屿都间接或直接与其他岛屿相同时所用的的最短时间  这就是一个简单的最小生成树的模板题,只要用了prime算法模板,但题是给出点的字母名,可以先转化为数字,在建立数组,就很容易写出来AC: import java.io.BufferedInputStream; import java.util.…
题目链接:http://acm.hust.edu.cn/vjudge/contest/126708#problem/F 题意:求至上而下一条路径的所经过的值得和最大值,这题比赛时就出了 但当时看不懂题目一直没写,这就和数字三角形差不多,只是加上了他的下部分,分上下两种情况就行. AC代码: #include<cstdio> #include <cstring> #include <iostream> using namespace std; int i,j,n; ][]…
题目链接:http://acm.hust.edu.cn/vjudge/contest/121192#problem/O 这道题是一道典型二分搜素题,题意是给定3个数组 每个数组的数有m个 再给定l个sum要求在每个数组中是否有一个数之和等于sum   首先对每一个数组进行排序 然后把前两个集合所有情况的数加起来并保存在一个sun数组里  再对最后一个数组中的元素被sum减   得到的值再去sun数组中寻找   有的话就存在退出,因为最后一个数组的大小会小于sun数组的大小 能够节省时间 ac代码…