版本比较
题解:P15368 『ICerOI Round 1』快进来听歌!
正文
增加 4 行删除 4 行
57 行未改动5859606162626364656621 行未改动88899091929293949595969798993 行未改动1031041051061071071081091101116 行未改动57 行未改动```
cnt为“1”的数量
当该位为“0”时 当该位为“0”时```cppcnt--
```21 行未改动 else{ while(x>0){ len++; t=x%2; x/=2; x/=2; a[len]=t; if(t==1)sum++; } } } if(sum==1){ if(k==len){ ans++;3 行未改动 if(flag==true){ for(int i=1;i<=len;i++){ if(a[i]==1)cnt++; else if(a[i]==0&&cnt>=2)cnt--; } } cnt--; if(k>=len+cnt){ ans++; }6 行未改动