Александра Рыбакова, 515 группа CubeSum 1279 | Чебанова Анастасия, 515гр CubeSum 1282 | ||||
---|---|---|---|---|---|
n | 1 | n = int(input()) | n | 1 | N = int(input()) |
2 | a = 1 | 2 | A = 1 | ||
3 | b = int(n ** (1 / 3)) | 3 | B = int(N ** (1 / 3)) | ||
4 | count = 0 | 4 | count = 0 | ||
n | 5 | while b > a: | n | 5 | while A < B: |
6 | if a ** 3 + b ** 3 < n: | 6 | if A ** 3 + B ** 3 < N: | ||
7 | a += 1 | 7 | A += 1 | ||
8 | elif a ** 3 + b ** 3 > n: | 8 | elif A ** 3 + B ** 3 > N: | ||
9 | b -= 1 | 9 | B -= 1 | ||
10 | else: | 10 | else: | ||
11 | count += 1 | 11 | count += 1 | ||
t | 12 | a += 1 | t | 12 | A += 1 |
13 | print(count) | 13 | print(count) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|