No.2510 Six Cube Sum Counting
タグ : / 解いたユーザー数 76
作問者 : 👑
amentorimaru
Problem Statement
You are given a non-negative integer $X$. Output the number of tuples of non-negative integers $(a,\ b,\ c,\ d,\ e,\ f)$ that satisfy all of the following conditions.
- $0 \le a \le b \le c \le d \le e \le f \le 300$
- $a^3 + b^3 + c^3 + d^3 + e^3 + f^3= X$
Input
$X $
Constraints
- $0 \le X \le 10^9$
- $X$ is an integer.
Output
Output the number of tuples of non-negative integers $(a,\ b,\ c,\ d,\ e,\ f)$.
Sample
Sample 1
Input
444
Output
1
Since $1^3+1^3+2^3+3^3+4^3+7^3 = 1+1+8+27+64+343 = 444$, the tuple $(a,\ b,\ c,\ d,\ e,\ f) = (1, 1, 2, 3, 4, 7)$ satisfies the conditions.
This is the only tuple of non-negative integers that satisfies the conditions. Note that $a \le b \le c \le d \le e \le f$ must hold.
Sample 2
Input
986
Output
2
The tuples of non-negative integers that satisfy the conditions are $(0, 2, 5, 5, 6, 8)$ and $(1, 4, 4, 4, 4, 9)$.
Sample 3
Input
51298165
Output
29423
Sample 4
Input
8042
Output
0
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。