在看一份题解的时候看到了一份代码,简化如下
map <int,int> cnt; if(cnt.count(x)) cnt[x]++; else cnt[x] = 1;
求问为什么要这样子写
难道不是直接这样子就好了吗
map <int,int> cnt; cnt[x]++
顺带捞一下
模拟退火求助