当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

7101:Time-division Multiplexing

题目描述
Time-division multiplexing (TDM) is a method of transmitting and receiving independent signals over a common signal path by means of synchronized switches at each end of the transmission line so that each signal appears on the line only a fraction of time in an alternating pattern. This method transmits two or more digital signals or analog signals over a common channel.

The time domain is divided into several recurrent time slots of fixed length, one for each sub-channel. A sample byte or data block of sub-channel 1 is transmitted during time slot 1, sub-channel 2 during time slot 2, etc. One TDM frame consists of one time slot per sub-channel plus a synchronization channel and sometimes error correction channel before the synchronization. After the last sub-channel, error correction, and synchronization, the cycle starts all over again with a new frame, starting with the second sample, byte or data block from sub-channel 1, etc.

There are $n$ time slots in total now, each of which periodically transmits a string only containing lowercase letters. You need to find the shortest slot length that contains all the different letters transmitted totally.
输入解释
This problem contains multiple test cases.

The first line contains a single integer $T$ ($1\leq T \leq 100$) indicating the number of test cases.

For each test case, the first line contains a single integer $n(1\leq n\leq 100)$. Then next $n$ lines, each line contains a string $s_i$ only containing lowercase letters. The length of each string is no more than $12$.

It is guaranteed that the $\sum n \leq 2000$.
输出解释
For each test case, output a single integer in a line, the answer for the test case.
输入样例
2
2
abc
bd
2
bab
bbc
输出样例
4
4
来自杭电HDUOJ的附加信息
Hint In the first sample, there are two time slots in total and s1 = abc, s2 = bd.Letters transmitted on the channel are as follows: abbdcbad...We can choose dcba as the answer string so the answer is 4.

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-7101

最后修改于 2021-10-23T19:11:26+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/3000MS(Java/Others) 262144/262144K(Java/Others)