文件名称:parking
介绍说明--下载内容均来自于网络,请自行研究使用
设停车场是一个可停放n辆车的狭长通道,且只有一个大门可供汽车进出。在停车场内,汽车按到达的先后次序,由北向南依次排列(假设大门在最南端)。若停车场内已停满n辆车,则后来的汽车需在门外的便道上等候,当有车开走时,便道上的第一辆车即可开入。当停车场内某辆车要离开时,在它之后进入的车辆必须先退出停车场为它让路,待该辆车开出大门后,其他车辆再按原次序返回车场。每辆车离开停车场时,应按其停留时间的长短交费(在便道上停留的时间不收费)。-Parking lots is an n vehicles parked narrow channel, and only one gate for vehicle access. In the parking lot, the cars arriving in the order, from north to south in order of priority (assuming the door at the southernmost tip). If the car parks have been full of parked cars n, then the car was required to wait outside on the sidewalk when a car pulled away, the first car on the pavement can be opened into. When the car park of a cars to leave, after it entered vehicles must exit to make way for its parking lot, waiting for the cars out the door, the other vehicle and then return to the original order of yards. When the vehicle left the parking lot shall be the length of their stay Contributions (in the pavement time is not spent on fees).
(系统自动生成,下载前可以参看下载内容)
下载文件列表
parking.cpp