Subsequence / UVA - 1121
Posted little-turtle--qjy
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Subsequence / UVA - 1121相关的知识,希望对你有一定的参考价值。
A sequence of N positive integers (10 < N < 100 000), each of them less than or equal 10000, and a positive integer S (S < 100 000 000) are given. Write a program to find the minimal length of the subsequence of consecutive elements of the sequence, the sum of which is greater than or equal to S.
Input
Many test cases will be given. For each test case the program has to read the numbers N and S, separated by an interval, from the first line. The numbers of the sequence are given in the second line of the test case, separated by intervals. The input will finish with the end of file.
Output
For each the case the program has to print the result on separate line of the output file.
Sample Input
10 15
5 1 3 5 10 7 4 9 2 8 5 11
12345
Sample Output
2 3
以上是关于Subsequence / UVA - 1121的主要内容,如果未能解决你的问题,请参考以下文章
UVA10871 Primed Subsequence欧拉筛法
UVA 10405 Longest Common Subsequence
UVA 11404Palindromic Subsequence
UVA 11404 Palindromic Subsequence[DP LCS 打印]
[HDU6155]Subsequence Count(线段树+矩阵)
oracle ORA-20011: Approximate NDV failed: ORA-29913: error in executing ODCIEXTTABLEOPEN callout(示例代