Bus Video System CodeForces - 978E(水题 思维)

这是一道关于公交视频监控系统记录乘客数量变化的题目。给定公交车站的数量和车辆容量,需要确定在第一站之前公交车上的可能人数。通过分析每个站点的增减人数,找出所有可能的初始人数,若存在矛盾则输出0。
摘要由CSDN通过智能技术生成
E. Bus Video System
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard 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 xx is the number of passengers in a bus just before the current bus stop and yy is the number of passengers in the bus just after current bus stop, the system records the number yxy−x. So the system records show how number of passengers changed.

The test run was made for single bus and nn bus stops. Thus, the system recorded the sequence of integers a1,a2,,ana1,a2,…,an (exactly one number for each bus stop), where 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值