cswork / OA打开练习工作台

DatabricksOA #13

Check Pattern Presence

估计简单可在线判题

考点(AI 标注)字符串

You are given a digit string panel and several code strings. Split each code into index and pattern, with the index part having length 1 through len(code)-1 in order; parse index as a decimal integer (leading zeros do not affect the value). If the contiguous segment of panel starting at that 0-based index exactly equals pattern, the result of that split is pattern; otherwise it is not found. Output the results in code order, then in order of split length.

Standard input/output and this site's supplementary ranges follow this problem's description.

输入格式

The first line contains panel (1..1000 ASCII digits); the second line contains c (1≤c≤100), followed by c lines, each an ASCII digit string code, with 2≤len(code)≤100 and total code characters ≤5000. The above upper bounds on c and code are site supplements that keep the output from becoming too large. Each index and pattern has at least one digit.

输出格式

Output one line per split: pattern if it matches, otherwise not found. The order follows the input order of code, and within each code, increasing split length.

样例 1

输入:

2311453915
2
0211
639

输出:

not found
11
not found
39
not found

样例 2

输入:

00000
2
000
101

输出:

00
0
not found
not found

样例 3

输入:

7
1
07

输出:

7