| # | Problem | Pass Rate (passed user / total user) |
|---|---|---|
| 4025 | String LD |
|
| 4026 | Painting |
|
| 4027 | Another Brick in the Wall |
|
| 4028 | Blast the Enemy! |
|
| 4029 | deltree |
|
| 4030 | Solar Eclipse |
|
Description
Stringld(left delete) is a function that gets a string and deletes its leftmost character (for instance Stringld(``acm") returns ``cm").
You are given a list of distinct words, and at each step, we apply stringld on every word in the list. Write a program that determines the number of steps that can be applied until at least one of the conditions become true:
- A word becomes empty string, or
- a duplicate word is generated.
For example, having the list of words aab, abac, and caac, applying the function on the input for the first time results in ab, bac, and aac. For the second time, we get b, ac, and ac. Since in the second step, we have two ac strings, the condition 2 is true, and the output of your program should be 1. Note that we do not count the last step that has resulted in duplicate string. More examples are found in the sample input and output section.
Input
There are multiple test cases in the input. The first line of each test case is n
Output
For each test case, write a single line containing the maximum number of stringld we can call.
Sample Input Download
Sample Output Download
Tags
Discuss
Description
Ethan wants to draw a painting on an m×n

Input
There are multiple test cases in the input. The first line of each test case contains two integers m
Output
For each test case, write a single line containing the order of colors used to paint the board. If there are several answers, output the one which is lexicographically smallest (considering each number as a symbol).
Sample Input Download
Sample Output Download
Tags
Discuss
Description
After years as a brick-layer, you've been called upon to analyze the instability of brick walls. The instability of a wall can be approximated by the maximum damage to a wall in case of taking one brick out. A brick will fall if all bricks that are directly underneath it are removed. Note that if the space underneath a brick is partially empty, it does not fall. You are given the description of all bricks in a wall, and must determine the instability of the wall as described in the following sections.
Input
There are multiple test cases in the input. Each test case consists of a single line, ``M N
- There is no brick such that the length of the brick does not conform to the digits in the brick (like 222 in the row 12221).
- No brick can fall initially.
Output
For each test case, write a single line containing maximum sum of the bricks' lengths that will fall if we take one brick out (including that brick).
Sample Input Download
Sample Output Download
Tags
Discuss
Description
A new computer game has just arrived and as an active and always-in-the-scene player, you should finish it before the next university term starts. At each stage of this game, you have to shoot an enemy robot on its weakness point. The weakness point of a robot is always the ``center of mass" of its 2D shape in the screen. Fortunately, all robot shapes are simple polygons with uniform density and you can write programs to calculate exactly the center of mass for each polygon.
Let's have a more formal definition for center of mass (COM). The center of mass for a square, (also circle, and other symmetric shapes) is its center point. And, if a simple shape C
.As a more formal definition, for a simple shape A

Input
The input contains a number of robot definitions. Each robot definition starts with a line containing n
Output
The i
Sample Input Download
Sample Output Download
Tags
Discuss
Description
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:
- cd < directory >
Assuming < directory >to be the name of a relative descendant of current directory, this command changes the current directory to < directory > . For example, when the current directory is `` AB" and one of its descendants is ``CD", the execution of ``cd CD" will change the current directory to ``ABCD".
- cd
This command changes the current directory to ``" (the root of the file system). For example, when the current directory is ``
AB", the execution of ``cd" will change the current directory to ``". cd ..Assuming the current directory to be anything except ``", this command changes the current directory to its parent directory. For example, when the current directory is ``
AB", the execution of ``cd .." will change the current directory to ``A".cd< directory >This command is equivalent to the execution of the following two commands:
cdcd< directory >dirThis command lists the name of files and directories directly in the current directory, each on a separate line. These filedirectory names are made up of (lowercase and uppercase) letters, digits, and dots (``."). Directory names precede the file names in the list, and each one, comes alone in a single line. On the contrary, each file name is accompanied by its size separated by a space. A sample output of ``dir" is as follows:
HW1 HW1.old Syllab.pdf 10000 notes.txt 3241
- deltree < directory >
Assuming < directory >
to be the name of a relative descendant of current directory, this command tries to delete < directory > and all its descendant files and subdirectories (and thus, freeing that much of space). For example, when the current directory is `` AB" and one of its descendants is ``CD", the execution of ``deltree CD" will try to delete directory ``ABCD" and all of its descendant files and directories. deltree< directory >This command is equivalent to the execution of the following two commands:
cddeltree< directory >exitThis command terminates the command line interface.
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
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.
Output
Write the result of the i
Sample Input Download
Sample Output Download
Tags
Discuss
Description
A new Solar Eclipse is going to happen in Mars. Scientists from different parts of the world are travelling to Mars to watch and study this phenomenon. You just managed to calculate exactly the best point of Mars lands for your study of the eclipse, and want to land your flying saucer on that place. But, you notice that there are already other spacecrafts landed on near that area.
In the bird's eye view, all the spacecrafts (including yours) are circles with constant radius R
Input
The input has multiple test cases. Each test case starts with a line containing an integer n
The input ends with a case of n = R = 0
Output
Write the result of the i