1017. Queueing at Bank 解析

注意:后面来的顾客是有可能不用排队的。 比如11:00顾客没有了13:00来人了是不用排队的。

在选取窗口的时候方法和之前那个1014的选择方法不同。注意对比。


…………………………更新线………………………………

再做完1026后更新下思路。简化了很多的代码。这里只要是在17点之前到的都会服务,不管有多晚。

所以在求最小窗口时间的时候一定要注意,min的值给大一点。我开始设置成EndTIme一直报错。。

还有在更新窗口时间的时候注意是服务的时刻加上业务时间,别直接累加了。1026也是同样的问题。

#include <iostream>
#include <algorithm>
#include <climits>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <stack>
#include <queue>
#include <set>

#define MAX 10010
#define MAX2 110
#define starttime 3600 * 8
#define endtime 3600 * 17

using namespace std;

int n,k;

struct person{
	int arrive;
	int process;
	int wait;
};
person l[MAX];
int win[MAX2];

bool cmp(person p1,person p2){
	return p1.arrive < p2.arrive;
}

int sumwait = 0;

int main(){

	scanf("%d%d",&n,&k);

	for(int i = 0; i < n ;i++){
		string t_str;
		cin >> t_str 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值