Welcome to Yumao′s Blog.
Jugs
——————————————————————————–
Time limit: 1 Seconds Memory limit: 32768K Special Judge
Total Submit: 939 Accepted Submit: 480
——————————————————————————–
In the movie “Die Hard 3”, Bruce Willis and Samuel L. Jackson were confronted with the following puzzle. They were given a 3-gallon jug and a 5-gallon jug and were asked to fill the 5-gallon jug with exactly 4 gallons. This problem generalizes that puzzle.