General program for the simulation of ant climbing
no vote
Application background A root of 27 cm of wood, in the first 3 cm, 7 cm, 11 cm, 17 cm, 23 cm the five positions on the ants. The wood is very thin, not through the two ant at the same time. At the beginning of the beginning of each ant's head which is not sure, they will only go forward or turn around, but will not retreat. When any two ants meet, two ants will also turn around to the opposite direction. Suppose ants can walk a centimeter per second. Write a program, the shortest time for all ants out of wood and the long time. Key Technology Solution: this may be the way most people think ofConsider the initial orientation of the ant colony, and simulate the movement of each ant to solve the problem.Solution two:Consider, although two ants meet after the turn to the opposite direction, however, can be seen as is two ants meet, pass (see here may be a lot of people have a feeling of suddenly it). That is to say that the ant movement independent,