如果你WAsub#1
你可能把cmp写成
pair<long double, int> cmx(pair<long double, int> a, pair<long double, int> b)
{
if (a.first - b.first > eps)
{
return a;
}
else if (a.first - b.first < eps)
{
return b;
}
else
{
return a.second < b.second ? a : b;
}
}
实际上应该是
pair<long double, int> cmx(pair<long double, int> a, pair<long double, int> b)
{
if (a.first - b.first > eps)
{
return a;
}
else if (b.first - a.first > eps)
{
return b;
}
else
{
return a.second < b.second ? a : b;
}
}