当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3903:Stock Exchange

题目描述
The world financial crisis is quite a subject. Some people are more relaxed while others are quite anxious. John is one of them. He is very concerned about the evolution of the stock exchange. He follows stock prices every day looking for rising trends. Given a sequence of numbers p1, p2,...,pn representing stock prices, a rising trend is a subsequence pi1 < pi2 < ... < pik, with i1 < i2 < ... < ik. John’s problem is to find very quickly the longest rising trend.
输入解释
Each data set in the file stands for a particular set of stock prices. A data set starts with the length L (L ≤ 100000) of the sequence of numbers, followed by the numbers (a number fits a long integer).
White spaces can occur freely in the input. The input data are correct and terminate with an end of file.
输出解释
The program prints the length of the longest rising trend.
For each set of data the program prints the result to the standard output from the beginning of a line.
输入样例
6 
5 2 1 4 5 3 
3  
1 1 1 
4 
4 3 2 1
输出样例
3 
1 
1
提示
There are three data sets. In the first case, the length L of the sequence is 6. The sequence is 5, 2, 1, 4, 5, 3. The result for the data set is the length of the longest rising trend: 3.

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3903

最后修改于 2020-10-29T07:15:03+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536