@@ -44,6 +44,9 @@ struct monkey_fit
s-=it->second; ++it;
}
+ if(p.empty())
+ return 0;
+
std::sort(p.begin(),p.end(),[](const std::tuple<T,T,int>&l,const std::tuple<T,T,int>&r){
return 1.*std::get<2>(l) > 1.*std::get<2>(r);
});