Logo
(追記) (追記ここまで)

7545번 - DNA Laboratory 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB66112.439%

문제

Having started to build his own DNA lab just recently, the evil doctor Frankenstein is not quite up to date yet. He wants to extract his DNA, enhance it somewhat and clone himself. He has already figured out how to extract DNA from some of his blood cells, but unfortunately reading off the DNA sequence means breaking the DNA into a number of short pieces and analyzing those first. Frankenstein has not quite understood how to put the pieces together to recover the original sequence.

His pragmatic approach to the problem is to sneak into university and to kidnap a number of smart looking students. Not surprisingly, you are one of them, so you would better come up with a solution pretty fast.

You are given a list of strings over the alphabet A (for adenine), C (cytosine), G (guanine), and T (thymine), and your task is to find the shortest string (which is typically not listed) that contains all given strings as substrings. If there are several such strings of shortest length, find the smallest in alphabetical/lexicographical order.

입력

The first line contains the number of scenarios.

For each scenario, the first line contains the number n of strings with 1 ≤ n ≤ 15. Then these strings with 1 ≤ length ≤ 100 follow, one on each line, and they consist of the letters “A”, “C”, “G”, and “T” only.

출력

The output for every scenario begins with a line containing “Scenario #i:”, where i is the number of the scenario starting at 1. Then print a single line containing the shortest (and smallest) string as described above. Terminate the output for the scenario with a blank line.

제한

예제 입력 1

1
2
TGCACA
CAT

예제 출력 1

Scenario #1:
TGCACAT

힌트

출처

University > Tu-Darmstadt Programming Contest > TUD Contest 2004 2번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /