Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int n;
- vector<int>time(n);
- int s = 0;
- int last = 0;
- vector<int>ans(n,0);
- for(int i=0;i<n;i++){
- if(ans[i]==-1){
- ans[i] = time[i];
- }
- else{
- int finish = 0;
- if(last < time[i]){
- finish = 300 + time[i];
- }
- else finish = 300 + last;
- for(int j=i+1;j<n;j++){
- if(finish < time[i])break;
- else{
- int ex = j - i -1;
- if(ex>10)ans[j] = -1;
- }
- }
- ans[i] = finish;
- last = finish;
- }
- }
- return ans;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement