E. Bus Video System

这道题目要求根据公交车经过n个站点后的上下车人数变化,以及车辆的最大载客量w,计算出车辆最初可能有多少种不同的载客数量。通过分析最大上车人数和最大下车人数来确定初始载客量的范围,并判断是否存在满足条件的情况。
摘要由CSDN通过智能技术生成

E. Bus Video System
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard output
The busses in Berland are equipped with a video surveillance system. The system records information about changes in the number of passengers in a bus after stops.

If
x
is the number of passengers in a bus just before the current bus stop and
y
is the number of passengers in the bus just after current bus stop, the system records the number
y

x
. So the system records show how number of passengers changed.

The test run was made for single bus and
n
bus stops. Thus, the system recorded the sequence of integers
a
1
,
a
2
,

,
a
n
(exactly one number for each bus stop), where
a
i
is the record for the bus stop
i
. The bus stops are

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值