QOJ.ac

QOJ

Limite de temps : 1 s Limite de mémoire : 128 MB Points totaux : 100

#4851. 排列

Statistiques

有多少种单词 $A$ 的不同排列包含单词 $B$? 请输出该数量除以 $10007$ 的余数。

输入格式

第一行包含一个由小写英文字母组成的字符串,即单词 $A$。字符串长度不超过 $500$。 第二行包含一个由小写英文字母组成的字符串,即单词 $B$。单词 $B$ 的长度不会超过单词 $A$。

输出格式

在第一行输出所求排列数量除以 $10007$ 的余数。

样例

输入 1

mirko
mir

输出 1

6

说明 1

包含单词 $mir$ 的六种排列为:$kmiro, komir, mirko, mirok, okmir$ 和 $omirk$。

输入 2

sssss
ss

输出 2

1

输入 3

barbarabarbara
barbabarba

输出 3

30

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.