文件名称:Title-Description
-
所属分类:
- 标签属性:
- 上传时间:2016-09-07
-
文件大小:944byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
题目描述
传说中有一种蜜汁序列特别甜,所以爱吃甜的强渣学长特别喜欢这种序列。。。
蜜汁序列的定义如下:对于一个长度为n的序列a1,...,an,如果这个序列的n个前缀和全部非负,即若a1> 0,a1+a2> 0,...,a1+a2+...+an> 0,则称a序列是蜜汁序列。。。
显然一些蜜汁序列可以分成更多的蜜汁序列,例如1 2这个蜜汁序列可以分成1和2两个蜜汁序列,现在有一个长度为n的蜜汁序列,要求你把他分成若干连续的段,使得每段都是一个蜜汁序列,问最多可以分成多少段?
输入
多组用例,每组用例首先输入一个整数n表示给出的蜜汁序列长度,之后输入n个整数a1,a2,...,an表示该序列的n个元素,以文件尾结束输入
输出
对于每组用例,输出一个整数占一行,表示该序列最多可以分成多少个蜜汁序列
数据范围
用例不超过10组,1< n< 10^6,-10^4< ai< 10^4(i 1,2,...,n)
样例输入
1
1
3
1 2 3
样例输出
1
3-Title Descr iption
There is a legend of the honey series especially sweet, so sweet strong slag seniors love this series...
The definition of honey sequences are as follows: for a length sequence of A1, N, an,... If the sequence of the N prefix and all non negative, i.e. a1> 0, a1+a2> 0,..., a1+a2+...+an> 0, said a sequence is a sequence of honey...
Obviously some honey honey sequence can be divided into more sequences, such as the 12 series of honey can be divided into 1 and 2 two honey series, now has a length of honey sequence n, ask you to put him into several consecutive segments, each segment is a sequence of honey, ask most can be divided into many segments?
input
Many groups of cases, each case first enter an integer n indicating honey sequence length are given, then input n integers A1, A2,..., an said that the sequence of n elements, the tail end of the input file
output
For each case, output one integer per line, said the most sequence can be divided into how
传说中有一种蜜汁序列特别甜,所以爱吃甜的强渣学长特别喜欢这种序列。。。
蜜汁序列的定义如下:对于一个长度为n的序列a1,...,an,如果这个序列的n个前缀和全部非负,即若a1> 0,a1+a2> 0,...,a1+a2+...+an> 0,则称a序列是蜜汁序列。。。
显然一些蜜汁序列可以分成更多的蜜汁序列,例如1 2这个蜜汁序列可以分成1和2两个蜜汁序列,现在有一个长度为n的蜜汁序列,要求你把他分成若干连续的段,使得每段都是一个蜜汁序列,问最多可以分成多少段?
输入
多组用例,每组用例首先输入一个整数n表示给出的蜜汁序列长度,之后输入n个整数a1,a2,...,an表示该序列的n个元素,以文件尾结束输入
输出
对于每组用例,输出一个整数占一行,表示该序列最多可以分成多少个蜜汁序列
数据范围
用例不超过10组,1< n< 10^6,-10^4< ai< 10^4(i 1,2,...,n)
样例输入
1
1
3
1 2 3
样例输出
1
3-Title Descr iption
There is a legend of the honey series especially sweet, so sweet strong slag seniors love this series...
The definition of honey sequences are as follows: for a length sequence of A1, N, an,... If the sequence of the N prefix and all non negative, i.e. a1> 0, a1+a2> 0,..., a1+a2+...+an> 0, said a sequence is a sequence of honey...
Obviously some honey honey sequence can be divided into more sequences, such as the 12 series of honey can be divided into 1 and 2 two honey series, now has a length of honey sequence n, ask you to put him into several consecutive segments, each segment is a sequence of honey, ask most can be divided into many segments?
input
Many groups of cases, each case first enter an integer n indicating honey sequence length are given, then input n integers A1, A2,..., an said that the sequence of n elements, the tail end of the input file
output
For each case, output one integer per line, said the most sequence can be divided into how
(系统自动生成,下载前可以参看下载内容)
下载文件列表
蜜汁序列.cpp
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.