Submission

Status:

(PPP-SSSSSSSSS)(PPPPPPPPP)(-SSSSSSSSS)(-SSSSSSSSS)(PP-SSSSSSSSSSS)(PP-SSSSSSSSSSSSSSSS)(PP-SSSSSSSSSSSSSSSSSSS)

Subtask/Task Score:

{0/4}{4/4}{0/5}{0/7}{0/25}{0/34}{0/21}

Score: 4

User: kungarooo

Problemset: ร้านปลอดภาษี (Duty Free)

Language: cpp

Time: 0.233 second

Submitted On: 2025-11-01 16:18:51

#include <bits/stdc++.h>
using namespace std;
// you can write more function here

int minimum_bag_rearrangement_time(vector<int> max_allowed_positions) {
  sort(max_allowed_positions.begin(),max_allowed_positions.end());
  int cnt=1,sz=max_allowed_positions.size();
  for(int i=0;i<sz;i++){
    if(max_allowed_positions[i]>=cnt){
      cnt++;
    }
  }
  cnt--;
  return (sz+cnt-1)/cnt-1;
}