llilyshkall CubeSum 1040 | Валерия Абдрахманова, 528 группа CubeSum 829 | ||||
---|---|---|---|---|---|
f | 1 | N = int(input()) | f | 1 | N = int(input()) |
2 | A = 1 | 2 | A = 1 | ||
3 | B = int(N ** (1 / 3)) | 3 | B = int(N ** (1 / 3)) | ||
n | 4 | ans = 0 | n | 4 | answer = 0 |
5 | while A <= B: | 5 | while A <= B: | ||
6 | sum = A ** 3 + B ** 3 | 6 | sum = A ** 3 + B ** 3 | ||
7 | if sum > N: | 7 | if sum > N: | ||
8 | B -= 1 | 8 | B -= 1 | ||
9 | else: | 9 | else: | ||
10 | A += 1 | 10 | A += 1 | ||
11 | if sum == N: | 11 | if sum == N: | ||
t | 12 | ans += 1 | t | 12 | answer += 1 |
13 | print(ans) | 13 | print(answer) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|