시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 128 MB | 0 | 0 | 0 | 0.000% |
You have just run out of disk space and decided to delete some of your directories. Rationally, you will first have an exploration of what you have in your file system. And more rationally, you will do this exploration through a command line interface. The interface used in this problem is called “MSDOS--”, since it is something like MSDOS with fewer features. The commands of MSDOS-- are as follows:
A “scenario” is an exploration (a consistent series of “cd” and “dir” commands and their results, starting from root) followed by exactly one “deltree” command. Given a scenario, you are to find the maximum space guaranteed to be freed by executing its “deltree” command.
Input contains multiple independent scenarios. There is an empty line after each scenario. The input ends with an “exit” command. There is a “>” sign before each command in the input (with no spaces in between). The length of each file name does not exceed 50. You may assume that the input is correct.
Write the result of the ith scenario as a single integer on the ith line of output.
>cd A >dir B C d 12 e 62 >cd B >cd .. >cd .. >deltree A >dir G s 2 >cd G >dir >cd \ >deltree G >dir A B x 3 >cd A >dir AA AB ax 10 ay 12 >cd AA >dir d 32 a 28 >cd .. >cd AB >dir F x 100 >cd F >dir G >cd \ >deltree A >cd D1\D2 >dir D3 a 32 >cd D3 >dir b 31 >cd \D1\D3 >dir d 7 >deltree \D1 >exit
74 0 182 70
ICPC > Regionals > Asia West Continent > Iran > Tehran Site 2008 E번