编程介的小学生 2019-11-20 17:59 采纳率: 20.5%
浏览 98

Match 的计算

Problem Description
Given three strings, find the length of the longest string which is a substring of each of the three input strings. In this problem "substring" has the usual definition. A string X is a substring of a string Y if and only if string X can be created from string Y by deleting zero or more consecutive characters from the start of string Y, and deleting zero or more consecutive characters from the end of string Y.

Input
The first line of the input is the number of test cases (less than 3000). For each case there is three lines each contains a string. The string only contains 'a'-'z' and up to 1000 characters long. There is a blank line before each test case.

Output
For each test case output the answer on a line.

Sample Input
3

aebcd
ebcaddwerd
fdsalebcser

sdafawerrsdfsdfwe
erfasdfafsd
egreetsdwere

aaaaa
aaaaa
aaaaa

Sample Output
3
2
5

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 运筹学排序问题中的在线排序
    • ¥15 关于#flink#的问题:关于docker部署flink集成hadoop的yarn,请教个问题flink启动yarn-session.sh连不上hadoop
    • ¥30 求一段fortran代码用IVF编译运行的结果
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题