Superstring 2 - MarisaOJ: Marisa Online Judge

Superstring 2

Time limit: 1000 ms
Memory limit: 256 MB
You are given $n$ string $S_1, S_2,...,S_n$. Find the shortest string $S$ that $S_1, S_2,...,S_n$ are substrings of $S$. ### Input - The first line contains an integer $n$. - The next $n$ lines, each line contains a string $S_i$. ### Output - Print the shortest string. ### Constraints - $1 \le n \le 50$. - $1 \le |S_i| \le 10$. ### Example Input: ``` 3 ab bcc da ``` Output: ``` dabcc ``` ### Scoring - All test cases are scored equally. - Consider the jury's string length as $Y$ and your string length as $X$. - If $X \le Y$, you receive a score of $100\%$ for test case. - If $1 < \frac{X}{Y} \le 1.5$, your score for the test case is calculated as $(\frac{3Y - 2X}{Y})^3\times 100 \\%$ . - If $\frac{X}{Y} > 1.5$, you receive a score of $0\%$ for the test case.