4522 unsigned current = 0;
4523 priority_queue<unsigned, vector<unsigned>, greater<unsigned>> pq;
4524 vector<customer> customers(n);
4525 for(
unsigned i = 0; i < n; i++) {
4529 customers[i] =
customer(i, time, min(60U, p) * 60);
4531 sort(customers.begin(), customers.end());
4532 for(
unsigned i = 0; i < k; i++) {
4533 pq.push(8 * 60 * 60);
4537 for(
auto &c: customers) {
4538 unsigned t = pq.top();
4540 if(c.arrive_time > 17 * 60 * 60) {
4543 const unsigned start_time = max(c.arrive_time, t);
4544 total += start_time - c.arrive_time;
4546 pq.push(start_time + c.p);
4549 << setprecision(1) <<
static_cast<double>(total) / cnt / 60;