随笔分类 - 动态规划:----------
摘要:题目描述 最近lxhgww又迷上了投资股票,通过一段时间的观察和学习,他总结出了股票行情的一些规律。 通过一段时间的观察,lxhgww预测到了未来T天内某只股票的走势,第i天的股票买入价为每股APi,第i天的股票卖出价为每股BPi(数据保证对于每个i,都有APi>=BPi),但是每天不能无限制地交易
阅读全文
摘要:描述 In order to celebrate the 8th anniversary of ZOJ, LCLL goes to a sauce factory to "Get Sauce". The factory has N kinds of materials. If we combine
阅读全文
摘要:描述 给两个有一定容量的箱子,往里面装宝石(宝石总容量不能超过箱子容量),不同的宝石有不同的容量和价值。求两个箱子里最大宝石的价值。 给两个有一定容量的箱子,往里面装宝石(宝石总容量不能超过箱子容量),不同的宝石有不同的容量和价值。求两个箱子里最大宝石的价值。 输入 line 1: Input n;
阅读全文
摘要:描述 Clickomania is a puzzle in which one starts with a rectangular grid of cells of different colours. In each step, a player selects ("clicks") a cell
阅读全文
摘要:描述 设有N*N的方格图(N<=10,我们将其中的某些方格中填入正整数,而其他的方格中则放入数字0。如下图所示(见样例): 某人从图的左上角的A 点出发,可以向下行走,也可以向右走,直到到达右下角的B点。在走过的路上,他可以取走方格中的数(取走后的方格中将变为数字0)。 此人从A点到B 点共走两次,
阅读全文
摘要:描述 Given an N×N grid of fields (1≤N≤500), each labeled with a letter in the alphabet. For example: ABCD BXZXCDXBWCBA Each day, Susa walks from the upp
阅读全文
摘要:描述 在河上有一座独木桥,一只青蛙想沿着独木桥从河的一侧跳到另一侧。在桥上有一些石子,青蛙很讨厌踩在这些石子上。由于桥的长度和青蛙一次跳过的距离都是正整数,我们可以把独木桥上青蛙可能到达的点看成数轴上的一串整点:0,1,……,L(其中L是桥的长度)。坐标为0的点表示桥的起点,坐标为L的点表示桥的终点
阅读全文
摘要:Summer is coming! It's time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n
阅读全文
摘要:Furik and Rubik take part in a relay race. The race will be set up on a large square with the side of n meters. The given square is split into n × n c
阅读全文
摘要:You are given an integer array of length nn. You have to choose some subsequence of this array of maximum length such that this subsequence forms a in
阅读全文
摘要:Genos recently installed the game Zuma on his phone. In Zuma there exists a line of n gemstones, the i-th of which has color ci. The goal of the game
阅读全文
摘要:Charlie is a driver of Advanced Cargo Movement, Ltd. Charlie drives a lot and so he often buys coffee at coffee vending machines at motorests. Charlie
阅读全文
摘要:Description Emma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping
阅读全文
摘要:描述 HaHa is so happy today, he is going to participate the 7th Hunan University Programming Contest. He woke up in the morning, and wanted to reach Hun
阅读全文
摘要:Problem Description ACboy很喜欢玩一种战略游戏,在一个地图上,有N座城堡,每座城堡都有一定的宝物,在每次游戏中ACboy允许攻克M个城堡并获得里面的宝物。但由于地理位置原因,有些城堡不能直接攻克,要攻克这些城堡必须先攻克其他某一个特定的城堡。你能帮ACboy算出要获得尽量多的
阅读全文
摘要:There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees
阅读全文
摘要:A school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new co
阅读全文
摘要:描述 JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tree 1, tree 2 ...and tree n.
阅读全文
摘要:描述 Seller: That will be fourteen dollars. Buyer: Here's a twenty. Seller: Sorry, I don't have any change. Buyer: OK, here's a ten and a five. Keep the
阅读全文
摘要:描述 Keeping track of all the cows can be a tricky task so Farmer John has installed a system to automate it. He has installed on each cow an electronic
阅读全文