蓝桥杯刷题--python-9(2023填空题2)

001串的熵 - 蓝桥云课 (lanqiao.cn)

import math

n = 23333333

for i in range(1, n >> 1):
    j = n - i
    a = -(i / n) * (math.log2(i / n)) * i - (j / n) * (math.log2(j / n)) * j
    a = round(a, 4)
    if a == 11625907.5798:
        print(i)
        break

 0求和 - 蓝桥云课 (lanqiao.cn)

 

n=20230408
print(n*(n+1)>>1)

你可能感兴趣的:(l蓝桥杯刷题python,蓝桥杯,python)