Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #define ll long long
- using namespace std;
- int main(){
- ll int n,box,capacity,i,prev=0,dum_capa,x;
- cin>>n>>box>>capacity;
- dum_capa = capacity;
- for(i=0;i<n;i++){
- cin>>x;
- if(prev!=x){
- box--;
- prev = x;
- dum_capa= capacity;
- }
- else{
- if(dum_capa==0){
- box--;
- dum_capa= capacity;
- }
- }
- dum_capa--;
- }
- cout<<abs(0-box)<<endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement