因为1一定是到达过的,所以可以这样枚举集合,省一半的常数。
for(int s=0;s<(1<<n);s+=2)
同时如果这样写别忘了统计答案的时候修改一下代码
for(int i=1;i<=n;i++) { ans=min(ans,f[i][(1<<n)-2]+d[1][i]); }