Submission
Status:
(PP-SSSSSSSSSS)(PPPPPPPPP)(PPPPPPPPPP)(-SSSSSSSSS)(-SSSSSSSSSSSSS)(-SSSSSSSSSSSSSSSSSS)(-SSSSSSSSSSSSSSSSSSSSS)
Subtask/Task Score:
{0/4}{4/4}{5/5}{0/7}{0/25}{0/34}{0/21}
Score: 9
User: kungarooo
Problemset: ร้านปลอดภาษี (Duty Free)
Language: cpp
Time: 0.122 second
Submitted On: 2025-11-01 16:26:00
#include <bits/stdc++.h>
using namespace std;
// you can write more function here
int minimum_bag_rearrangement_time(vector<int> max_allowed_positions) {
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;
}