|
|
computer n communication system engineering 基地!
[复制链接]
|
|
|
发表于 13-4-2009 08:37 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 14-4-2009 06:34 PM
|
显示全部楼层
jacky & DK, LI 怎样了?
等着你的分享 |
|
|
|
|
|
|
|
|
|
|
发表于 14-4-2009 10:27 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 14-4-2009 10:54 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 14-4-2009 11:38 PM
|
显示全部楼层
很快就要开始 LI 咯。
复杂的心情,过后再和各位分享心得。 |
|
|
|
|
|
|
|
|
|
|
发表于 14-4-2009 11:41 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 14-4-2009 11:43 PM
|
显示全部楼层
原帖由 jackyboy05 于 14-4-2009 11:38 PM 发表 
很快就要开始 LI 咯。
复杂的心情,过后再和各位分享心得。
还有16天,就要开工了,感觉不错吧 |
|
|
|
|
|
|
|
|
|
|
发表于 15-4-2009 01:52 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 16-4-2009 01:29 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 17-4-2009 12:42 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 17-4-2009 03:28 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 17-4-2009 09:47 PM
|
显示全部楼层
08/09 sem02 OOP final test question
Question 1
A seaport container terminal stores large containers that are eventually loaded on seagoing ships for transport abroad. Containers coming to the terminal by road and rail are stacked at the terminal as they arrive.
Seagoing ships carry large numbers of containers. The time to load a ship depends in part on the locations of its containers. The loading time increases when the containers are not on the top of the stacks, but can be fetched only after removing other containers that are on top of them.
The container terminal needs a plan for stacking containers in order to decrease loading time. The plan must allow each ship to be loaded by accessing only topmost containers on the stacks, and minimizing the total number of stacks needed.
For this problem, we know the order in which ships must be loaded and the order in which containers arrive. Each ship is represented by a capital letter between A and Z (inclusive), and the ships will be loaded in alphabetical order. Each container is labeled with a capital letter representing the ship onto which it needs to be loaded. There is no limit on the number of containers that can be placed in a single stack.
Input
The input file contains multiple test cases. Each test case consists of a single line containing from 1 to 1000 capital letters representing the order of arrival of a set of containers. For example, the line ABAC means consecutive containers arrive to be loaded onto ships A, B, A, and C, respectively. When all containers have arrived, the ships are loaded in strictly increasing order: first ship A, then ship B, and so on.
A line containing the word end follows the last test case.
Output
For each input case, print the case number (beginning with 1) and the minimum number of stacks needed to store the containers before loading starts. Your output format should be similar to the one shown here.
Sample Input
A
CBACBACBACBACBA
CCCCBBBBAAAA
ACMICPC
end
Sample Output
Case 1: 1
Case 2: 3
Case 3: 1
Case 4: 4 |
|
|
|
|
|
|
|
|
|
|
发表于 18-4-2009 09:25 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 18-4-2009 10:03 AM
|
显示全部楼层
post 爽~  |
|
|
|
|
|
|
|
|
|
|
发表于 23-4-2009 10:24 AM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 5-5-2009 02:26 PM
|
显示全部楼层
LI的,怎么没有上来报告? |
|
|
|
|
|
|
|
|
|
|
发表于 5-5-2009 08:02 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 5-5-2009 11:22 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 11-5-2009 04:56 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
|
|
发表于 11-5-2009 08:55 PM
|
显示全部楼层
|
|
|
|
|
|
|
|
| |
本周最热论坛帖子
|