正文
增加 6 行删除 6 行
11 行未改动121314151617181920212223242526272829303132333477 行未改动1121131141151161171181191205 行未改动12612712812913013113213313417 行未改动11 行未改动stack<int>stk;signed main(){cin>>n;for(int i=1;i<=n;i++){cin>>d[i]>>w[i];while(stk.size() && w[stk.top()]>w[i]){stk.pop();}if(!stk.size() || w[stk.top()]<w[i]){sum++;}stk.push(i);}cout<<sum;return 0 ;}```### CF547B Mike and Feet###### 1.题意:给你n个元素的数列,让你求对于每个长度len的区间最小值。77 行未改动stack<stu>op,ans;signed main(){ios::sync_with_stdio(0);cin.tie(0);cin>>n;for(int i=1;i<=n;++i){double x;5 行未改动int len=op.top().len;op.pop();x=(sum.val*sum.len+x*len)*1.0/(sum.len+len);sum.val=x;sum.len+=len;}op.push(sum);}while(op.size())17 行未改动11 行未改动121314151617181920212223242526272829303132333477 行未改动1121131141151161171181191205 行未改动12612712812913013113213313417 行未改动11 行未改动stack<int>stk;signed main(){cin>>n;for(int i=1;i<=n;i++){cin>>d[i]>>w[i];while(stk.size() && w[stk.top()]>w[i]){stk.pop();}if(!stk.size() || w[stk.top()]<w[i]){sum++;}stk.push(i);}cout<<sum;return 0 ;}```### CF547B Mike and Feet###### 1.题意:给你n个元素的数列,让你求对于每个长度len的区间最小值。77 行未改动stack<stu>op,ans;signed main(){ios::sync_with_stdio(0);cin.tie(0);cin>>n;for(int i=1;i<=n;++i){double x;5 行未改动int len=op.top().len;op.pop();x=(sum.val*sum.len+x*len)*1.0/(sum.len+len);sum.val=x;sum.len+=len;}op.push(sum);}while(op.size())17 行未改动