for(int i=1;i<=n;i++){ std::multiset::iterator tmp; tmp = se.lower_bound(t); while(tmp != se.end()){ std::cout << *tmp << std::endl; tmp++; } // ans+=(tmp-1) t=t+a[i]; se.erase(sum[i]); }

forint i=1;i=n;i++		stdmultisetintiterator tmp;		tmp = selower_boundt; 	stdcout tmp stdendl;		ans+=tmp-1		t=t+ai;		seerasesumi;	修改上述代码使其每次输出的为大于等于t的se的下标

原文地址: https://www.cveoy.top/t/topic/h1Mg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录