两个示例各自的时间复杂度。
for a in range(1001): for b in range(1001): for c in range(1001): if a + b + c == 1000 and a**2 + b**2 == c**2: print(a, b, c)