编程介的小学生 2019-12-31 01:14 采纳率: 20.5%
浏览 99

KFC -Z+W 的问题

Problem Description
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
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)

Output
For each case, please output the least time to wait in one line.

Sample Input
3 2 2 1 2
ABCCBACBCBAB
CBCBABBCBA
ABC

Sample Output
31

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 关于大棚监测的pcb板设计
    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)