32 厨师做饭
一个厨师出售1~6种不同的食物,每种食物都需要使用各自的特殊厨具,厨师的灶台最多只能同时摆放3种厨具,所以厨师决定空间不够时就更换最久没使用过的厨具。每种食物烹饪都需要15分钟,更换一次厨具需要6分钟。请计算按点单顺序完成输入的点单列表所需时间。
输入描述
每行一个数字,1~6代表6种订单,7代表结束
输出描述
一个数字,代表厨师需要的总时间
示例1
输入
2
2
5
6
4
2
4
6
5
2
3
3
3
3
4
6
1
5
1
1
7
输出
354
// 本题为考试多行输入输出规范示例,无需提交,不计分。
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int x[3] = {
}, cur = 0;
int a;
int res = 0;
while (cin>>a) {
if (a == 7) {
break;
}
int flag = 0;
for (int i = 0;