FINALS95.HTM 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <BODY BGCOLOR="#ffffff" LINK ="#078c52" ALINK ="#078c52" VLINK = "#e64204" >
  2. <h1>1995 USACO Final Round</h1>
  3. <h2> Day 1, June 1, 1995</h2>
  4. <h3>Problem 1: Cows on Parade</h3>
  5. <pre>
  6. Farmer John was marching 19 of his finest black Angus and white Jersey
  7. cows to market the other day when his wife, Farmeress Joanne, noticed
  8. that all 16 possible combinations of four successive black and white
  9. cows (e.g., bbbb, bbbw, bbwb, bbww, ..., wwww) were present (as
  10. contiguous cow-subsequences) as the parade passed by. Of course, some
  11. of the combinations overlapped others.
  12. Part 1: Print any ordering of 19 marching black and white cows that
  13. contains all the possible four-color combinations.
  14. Part 2: Accept as console input the number of cows and the length of
  15. the subsequence and print any ordering of the cows that contains all
  16. the possible color combinations. Typical lengths and subsequences
  17. are: 2,5; 3,10; 4,19; 5,36 and more. The number of cows will not
  18. exceed 32,782 and the length of the subsequence will not exceed 15. It
  19. is guaranteed that a solution will exist. Your program must run in
  20. less than 30 seconds.
  21. [Charley Ashbacher; JRM 25:4 p299 '93]
  22. </pre>
  23. <hr>
  24. </body>