源码简介: |
设停车场是一个可以停放n辆汽车的狭长通道,且只有一个大门可以供车辆进出。车辆按到达停车场时间的早晚依次从停车场最里向大门口处停放(最先到达的第一辆车放在停车场的最里面)。如果停车场已放满n辆车,则后来的车只能在停车场大门外的便道上等待,一旦停车场内有车开走,则排在便道上的第一辆车就进入停车场。停车场内如有某辆车要开走,在它之后进入停车场的车都必须先退出停车场为它让路,待其开出停车场后,这些车辆再依原来的次序进场。-Parking lots is a vehicle that can accommodate long and narrow channel n, and only one door can be used for vehicle access. Parking of vehicles arrival time of the morning and evening by order of the most in from the parking lot entrance to the park office (the first arrival of the first car on the parking lot of the most inside). If the car park had been filled with n vehicles, the car was only the sidewalk in the parking lot outside the gate waiting for, once the car parks a car drive away, then came in the first car on the sidewalk into the parking lot. Car parks with a certain car to drive away, into the parking lot after it must first leave the car parking to make way for it, let it out parking, these vehicles then follow the original order entry.
|