Four simulations, from one gate to a whole spaceport: make the program do exactly what the statement says, in its order.
- The cows at the gate are the lesson's printer: sort them by arrival time, put
them in a queue, and move the clock with
t = max(t, arrival) + durationfor the cow at the front. - Очередь задач has a Russian statement. Its days go up to 10¹⁴, so jump from one addition to the next instead of ticking day by day.
- The train siding is the lesson's siding: push cars until the wanted one has arrived, then it must be on top.
- Orbital Cargo Control uses a queue, a deque and a stack at once. A command on
an empty area prints
EMPTYand changes nothing; the total masses needlong long; and every other command prints exactly one line.