Мельников Алексей, Севастополь CubeSum 1285 | Сенюшкина Алина Константиновна 321 CubeSum 1559 | ||||
---|---|---|---|---|---|
n | 1 | N = int(input()) | n | 1 | n = eval(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 A <= B: | n | 5 | while a <= b: |
6 | if A ** 3 + B ** 3 > N: | 6 | if a ** 3 + b ** 3 > n: | ||
7 | B -= 1 | 7 | b -= 1 | ||
8 | elif A ** 3 + B ** 3 < N: | 8 | elif a ** 3 + b ** 3 < n: | ||
9 | A += 1 | 9 | a += 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 | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|