安徽科技工程大学程序设计在线考试系统Ver3.0

诚信考试,杜绝作弊!

问题 K: 14_B : String Search

内存限制:512 MB 时间限制:1 S 标准输入输出
题目类型:传统 评测方式:文本比较

题目描述

String Search 

Find places where a string P is found within a text T. Print all indices of T where P found. The indices of T start with 0.

输入格式

In the first line, a text T is given. In the second line, a string P is given.

输出格式

Print an index of T where P found in a line. Print the indices in ascending order.

输入样例 复制

aabaaa
aa

输出样例 复制

0
3
4

数据范围与提示

1 ≤ length of T ≤ 1000000 

1 ≤ length of P ≤ 10000 

The input consists of alphabetical characters and digits