03 2017 档案
摘要:描述 ACM队的mdd想做一个计算器,但是,他要做的不仅仅是一计算一个A+B的计算器,他想实现随便输入一个表达式都能求出它的值的计算器,现在请你帮助他来实现这个计算器吧。 比如输入:“1+2/4=”,程序就输出1.50(结果保留两位小数) 输入 第一行输入一个整数n,共有n组测试数据...
阅读全文
摘要:怀特先生是一名研究地震的科学家,最近他发现如果知道某一段时间内的地壳震动能量采样的最小波动值之和,可以有效地预测大地震的发生。假设已知一段时间的n次地壳震动能量的采样值为a1,a2,…an,那么第i 次采样的最小波动值为min{ |ai-aj| , i小于j小于等于n}, 即第i...
阅读全文
摘要:Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells...
阅读全文
摘要:TIANKENG manages a restaurant after graduating from ZCMU, and tens of thousands of customers come to have meal because of its delicious dishes...
阅读全文
摘要:On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it’s so nice, isn’t it? To celebrate this meaningful ...
阅读全文
摘要:匈牙利算法是由匈牙利数学家Edmonds于1965年提出,因而得名。匈牙利算法是基于Hall定理中充分性证明的思想,它是二部图匹配最常见的算法,该算法的核心就是寻找增广路径,它是一种用增广路径求二分图最大匹配的算法。设 G=(V,E) 是一个无向图。如顶点集V可分割为两个互不相交的...
阅读全文
摘要:Give you three sequences of numbers A, B, C, then we give you a number X. Now you need to calculate if you can find the three numbers Ai, Bj, ...
阅读全文
摘要:Description众所周知的是,TMK特别容易迟到,终于在TMK某次又迟到了之后,Maple怒了,Maple大喊一声:“我要跟你决一死战!”然后Maple就跟TMK玩起了一个关于占点的游戏。 Maple在一个无限展开的只有整数点的二维平面上找到两个点,由TMK和Maple分别操控...
阅读全文
摘要:Recently, iSea went to an ancient country. For such a long time, it was the most wealthy and powerful kingdom in the world. As a result, the p...
阅读全文
摘要:设2n张牌分别标记为1, 2, …, n, n+1, …, 2n,初始时这2n张牌按其标号从小到大排列。经一次洗牌后,原来的排列顺序变成n+1, 1, n+2, 2, …, 2n, n。即前n张牌被放到偶数位置2, 4, …, 2n,而后n张牌被放到奇数位置1, 3, …, 2n-1...
阅读全文
摘要:Inhabitants of the Wonderland have decided to hold a regional programming contest. The Judging Committee has volunteered and has promised to o...
阅读全文
摘要:N! (N factorial) can be quite irritating and difficult to compute for large values of N. So instead of calculating N!, I want to know how many...
阅读全文
摘要:The objective of the program you are going to produce is to evaluate boolean expressions as the one shown next: Expression: ( V | V ) & F & (...
阅读全文
摘要:ZS the Coder and Chris the Baboon arrived at the entrance of Udayland. There is a n × n magic grid on the entrance which is filled with intege...
阅读全文
摘要:Given the N integers, you have to find the maximum GCD (greatest common divisor) of every possible pair of these integers. Input The first lin...
阅读全文
摘要:Time Limit: 1000 MS Memory Limit: 131072 K DescriptionThere are two lists and they may be intersected with each other. You must judge if th...
阅读全文
摘要:Time Limit: 1000 MS Memory Limit: 131072 K DescriptionMisaka Mikoto is a main character of the Animation “To Aru Majutsu no Index” and “To ...
阅读全文
摘要:Time Limit: 1000 MS Memory Limit: 131072 K DescriptionLong time ago, a king occupied a vast territory. Now there is a problem that he worri...
阅读全文
摘要:单调栈与单调队列很相似。首先栈是后进先出的,单调性指的是严格的递增或者递减。 单调栈有以下两个性质: 1、若是单调递增栈,则从栈顶到栈底的元素是严格递增的。若是单调递减栈,则从栈顶到栈底的元素是严格递减的。 2、越靠近栈顶的元素越后进栈。 单调栈与单调队列不同的地方在于栈只能在栈顶操...
阅读全文
摘要:Largest Rectangle in a Histogram Time Limit: 1000MS Memory Limit: 65536K Total Submissions: ...
阅读全文
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outpu...
阅读全文
摘要:Problem Description A Fibonacci sequence is calculated by adding the previous two members the sequence, with the first two members being both ...
阅读全文
摘要:## Nearest Neighbor Search ##Input file: standard input Output file: standard output Time limit: 1 second Memory limit: 1024 megabyt...
阅读全文
摘要:You have number a, whose decimal representation quite luckily contains digits 1, 6, 8, 9. Rearrange the digits in its decimal representation so that t...
阅读全文
摘要:Simon has a prime number x and an array of non-negative integers a1, a2, ..., an.Simon loves fractions very much. Today he wrote out number on a piec...
阅读全文
摘要:A triangle field is numbered with successive integers in the way shown on the picture below. The traveller needs to go from the cell with number M to ...
阅读全文
摘要:Mr. Santa asks all the great programmers of the world to solve a trivial problem. He gives them an integer m and asks for the number of positive integ...
阅读全文
摘要:Masha wants to open her own bakery and bake muffins in one of the n cities numbered from 1 to n. There are m bidirectional roads, each of whose connec...
阅读全文
摘要:Problem DescriptionBecause of the huge population of China, public transportation is very important. Bus is an important transportation method in trad...
阅读全文
摘要:Problem Description One day, Tom traveled to a country named BGM. BGM is a small country, but there are N (N #include#include#include#include#inc...
阅读全文
摘要:Problem DescriptionXX星球有很多城市,每个城市之间有一条或多条飞行通道,但是并不是所有的路都是很安全的,每一条路有一个安全系数s,s是在 0 和 1 间的实数(包括0,1),一条从u 到 v 的通道P 的安全度为Safe(P) = s(e1)*s(e2)…*s(ek) e1,e2...
阅读全文
摘要:Problem Description给你n个点,m条无向边,每条边都有长度d和花费p,给你起点s终点t,要求输出起点到终点的最短距离及其花费,如果最短距离有多条路线,则输出花费最少的。 Input输入n,m,点的编号是1~n,然后是m行,每行4个数 a,b,d,p,表示a和b之间有一条边,且其长度...
阅读全文