[GESP202403 四级] 相似字符串
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
题目描述
对于两个字符串 和 ,如果 可以通过删除一个字符,或插入一个字符,或修改一个字符变成 ,那么我们说 和 是相似的。
比如 可以通过插入一个字符变成 ,可以通过删除一个字符变成 ,也可以通过修改一个字符变成 。因此 和 、、 都是相似的。但 并不能 通过任意一个操作变成 ,因此它们并不相似。
特别地,两个完全相同的字符串也是相似的。
给定 组 ,请你分别判断它们是否相似。
输入格式
第一行一个正整数 。
接下来 行,每行两个用空格隔开的字符串 和 。
输出格式
对组 ,如果他们相似,输出 similar
,否则输出 not similar
。
5
apple applee
apple appe
apple bpple
applee bpple
apple apple
similar
similar
similar
not similar
similar
提示
对全部的测试数据,保证 , 和 的长度不超过 ,仅含小写字母。
2024~2025第二学期入门选修课期末考
- Status
- Done
- Rule
- IOI
- Problem
- 6
- Start at
- 2025-6-13 16:15
- End at
- 2025-6-13 17:15
- Duration
- 1 hour(s)
- Host
- Partic.
- 19