注意:后面来的顾客是有可能不用排队的。 比如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