RT,我这样写操作3,就会13pts:
tot -= mp[k][b], kl[k] -= mp[k][b];
mp[k][b] = 0;
for (auto it = kl.begin(); it != kl.end(); ++it)
{
if (it->first != k)
{
mp.erase(it->first);
tot -= it->second;
}
}
但是我这样写,就是100pts:
for (auto it = kl.begin(); it != kl.end(); ++it)
{
if (it->first != k)
{
mp.erase(it->first);
tot -= it->second;
}
}
kl.clear();
tot -= mp[k][b], kl[k] = tot;
mp[k][b] = 0;
想问一下这是为啥