当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3886:Baby's Blocks

题目描述
Mikey is playing with his favorite toy blocks, each depicting one letter of the alphabet. He is trying to make words using all his blocks, but as he does not know valid words from invalid ones, he goes by all possible orderings of the letters in alphabetical order and asks Albert, his genius brother, if the word he made is a valid one. Mikey can make one word (including asking a question and getting an answer) every sixty seconds, and he never makes the same word twice.
Albert is delighted about Mikey's activity, but would rather not teach Mikey certain words. Help Albert by predicting when Mikey will start making a certain forbidden word, so he can set the alarm clock indicating Mikey's bedtime to just before this moment.
输入解释
On the first line of the input is a positive integer, the number of test cases. Then for each test case:
A line containing the forbidden word to look for, consisting of at most 20 upper case characters. This word can be formed exactly using all of Mikey's blocks.
输出解释
For each test case:
One line containing the number of minutes it will take until the forbidden word is reached, assuming Mikey has just started making the first possible word.
输入样例
4
ABC
FSCK
OMGWFTBBQ
BANANA
输出样例
0
10
112293
34

该题目是Virtual Judge题目,来自 北京大学POJ

题目来源 BAPC 2009

源链接: POJ-3886

最后修改于 2020-10-29T07:14:40+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536