report VI VI EN
Register | Login
  • HOME
  • PROBLEMSET
  • ROADMAP
  • COMPETITION
  • TOPIC
  • RANKING
  • GUIDE
  • MASHUP
  • ABOUT
  • CONTACT
  • Problem
  • Submit
  • Results
Superstring - MarisaOJ: Marisa Online Judge

Superstring

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 20$. - $1 \le |S_i| \le 100$. ### Example Input: ``` 3 ab bcc da ``` Output: ``` dabcc ```
Bitmask DP
Binary board
Travelling Salesman Problem 2
Brewing potion 5
Subsequences counting
Wooden house
Xiangqi
Packing
Permutation counting
Counting tilings
Superstring
Custom keyboard
Mushroom harvesting III
Topic
Dynamic Programming
Bitmasks
Rating 1600
Solution (0) Solution