Submission

Status:

(PPP-SSSSSSSSS)(PPPPPPPPP)(PPPPPPPPPP)(PPPPPPPPPP)(-SSSSSSSSSSSSS)(-SSSSSSSSSSSSSSSSSS)(-SSSSSSSSSSSSSSSSSSSSS)

Subtask/Task Score:

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

Score: 16

User: kungarooo

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

Language: cpp

Time: 0.233 second

Submitted On: 2025-11-01 16:26:52

#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(),ans=0;
  for(int i=0;i<sz;i++){
    if(max_allowed_positions[i]>=cnt){
      cnt++;
    }else{
      cnt=2;
      ans++;
    }
  }
  return ans;
}