A7824 | Test
时间限制1s
内存限制256MB
通过 / 提交0/0
题目描述
Sometimes it is hard to prepare tests for programming problems. Now Bob is preparing tests to new problem about strings — input data to his problem is one string. Bob has 3 wrong solutions to this problem. The first gives the wrong answer if the input data contains the substring $s_{1}$ , the second enters an infinite loop if the input data contains the substring $s_{2}$ , and the third requires too much memory if the input data contains the substring $s_{3}$ . Bob wants these solutions to fail single test. What is the minimal length of test, which couldn't be passed by all three Bob's solutions?
有时,为编程问题准备测试很困难。现在,鲍勃正在为有关字符串的新问题准备测试--问题的输入数据是一个字符串。对于这个问题,鲍勃有三种错误的解决方案。如果输入数据中包含子串 s1 ,第一个方案就会给出错误答案;如果输入数据中包含子串 s2 ,第二个方案就会进入无限循环;如果输入数据中包含子串 s3 ,第三个方案就会占用过多内存。鲍勃希望这些解决方案都不能通过单项测试。鲍勃的三个解决方案都不能通过的最小测试长度是多少?
有时,为编程问题准备测试很困难。现在,鲍勃正在为有关字符串的新问题准备测试--问题的输入数据是一个字符串。对于这个问题,鲍勃有三种错误的解决方案。如果输入数据中包含子串 s1 ,第一个方案就会给出错误答案;如果输入数据中包含子串 s2 ,第二个方案就会进入无限循环;如果输入数据中包含子串 s3 ,第三个方案就会占用过多内存。鲍勃希望这些解决方案都不能通过单项测试。鲍勃的三个解决方案都不能通过的最小测试长度是多少?
输入格式
There are exactly 3 lines in the input data. The $i$ -th line contains string $s_{i}$ . All the strings are non-empty, consists of lowercase Latin letters, the length of each string doesn't exceed $10^{5}$ .
输入
输入数据中正好有 3 行。第 i 行包含字符串 si 。所有字符串都是非空字符串,由小写拉丁字母组成,每个字符串的长度不超过 $10^{5}$ 。
输入
输入数据中正好有 3 行。第 i 行包含字符串 si 。所有字符串都是非空字符串,由小写拉丁字母组成,每个字符串的长度不超过 $10^{5}$ 。
输出格式
Output one number — what is minimal length of the string, containing $s_{1}$ , $s_{2}$ and $s_{3}$ as substrings.
输出
输出一个数字 - 字符串的最小长度,包含 s1 、 s2 和 s3 作为子串。
输出
输出一个数字 - 字符串的最小长度,包含 s1 、 s2 和 s3 作为子串。
输入输出样例
输入 #1
ab bc cd
输出 #1
4
输入 #2
abacaba abaaba x
输出 #2
11
暂无题解
C++ 编辑器
输入
输出
可保存默认模板;新题优先使用已保存模板。
当前快捷键仅展示,暂不支持修改。
- 撤销
Ctrl / ⌘ + Z - 重做
Ctrl / ⌘ + Y - 查找
Ctrl / ⌘ + F - 全选
Ctrl / ⌘ + A - 复制
Ctrl / ⌘ + C - 剪切
Ctrl / ⌘ + X - 粘贴
Ctrl / ⌘ + V - 自动排版
工具栏排版按钮 - 草稿保存
编辑时自动保存到本机
历史
提交记录
状态说明时间源码
AI
作答助手
你好,我是作答助手。可以问思路、复杂度、样例含义或代码报错原因;不会直接给出完整 AC 代码。
确定要清空代码吗?
提交通过
评测结果:Accepted