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

建议使用的浏览器:

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

4147:KFC -Z+W

题目描述
Welcome to KFC!
We love KFC, but we hate the looooooooooong queue.
Z is a programmer; he’s got an idea on the queue time computing.
Z chooses the shortest queue at first time.
He wrote a j2me program to predicate the time he have to wait in the queue. Now, he comes to KFC to test his program.
BUT, he ignored some important things to get the precise time.
* People choose different foods
* Time used on foods various
W encountered him just while his wondering on the problem, so he discussed it with HER.
W suggested that they can add variables to this
* A type ,who is looking down on the cell phone novel should come here alone, will call for 1 hamburger, 1 drink and 1 small fries
* B type, two talkative lovers, 1 hamburger and 1 drink for each one and another big fires
* C type, middle aged father/mother looks, brings their child out. 3 hamburgers, 3 drinks and two big friezes.
Generally represent the types usually appear, not the exactly math work.
They reprogram the app on W’s HTC-G1 with bash, run it and go for the fastest queue.
输入解释
Input contains multiple test cases, and for each case:
First line: n B D f F, stands for n queues, time for hamburger B, time for Drink D, time for small fries f, time for big Fries F.
The next n lines: the types of each line using ABC characters.
(1<n,B,D,f,F<=100)
输出解释
For each case, please output the least time to wait in one line.
输入样例
3 2 2 1 2
ABCCBACBCBAB
CBCBABBCBA
ABC
输出样例
31
来自杭电HDUOJ的附加信息
Author zhblue@ZJICM
Recommend lcy

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-4147

最后修改于 2020-10-25T23:10:42+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 65535/32768K(Java/Others)