| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 73023 | 彭士宝 | 完美立方 | Python3 | Compile Error | 0 MS | 0 KB | 607 | 2024-05-15 21:03:29 |
import math def find_perfect_cubes(N): perfect_cubes = [] for a in range(2, N+1): a_cube = a ** 3 for b in range(2, a): for c in range(b, a): for d in range(c, a): if b ** 3 + c ** 3 + d ** 3 == a_cube: perfect_cubes.append((a, (b, c, d))) break perfect_cubes.sort(key=lambda x: (x[0], x[1][0], x[1][1], x[1][2])) for a, triple in perfect_cubes: print(f"Cube = {a}, Triple = {triple}") N = int(input()) find_perfect_cubes(N) print(find_perfect_cubes(N))
File "Main.py", line 14
print(f"Cube = {a}, Triple = {triple}")
^
SyntaxError: invalid syntax