AC但是疑惑
查看原帖
AC但是疑惑
364848
Bodhi楼主2024/1/7 17:00

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; // 重合的擦掉

想问一下这是为啥

2024/1/7 17:00
加载中...