class Solution { public: int timeRequiredToBuy(vector<int>&t,int k) { int i=0,s=0;for(int a:t) s+=min(t[k]-(i++>k),a); return s; } };
给出一份极简解