#include<bits/stdc++.h>
#define ll long long int
using namespace std;
ll a[22];
void need(ll n)
{
ll i, j, t[n+1];
for(i=1; i<=n; i++)
t[i] = 0;
t[0] = 1;
for(i=1; i<=21; i++)
{
for(j=a[i]; j<=n; j++)
{
t[j] = t[j] + t[j-a[i]];
}
}
cout << t[n] << "\n";
}
int main()
{
for(int i=1;i<=21;i++)
a[i] = i*i*i;
ll n;
while(cin >> n)
{
need(n);
}
return 0;
}
#define ll long long int
using namespace std;
ll a[22];
void need(ll n)
{
ll i, j, t[n+1];
for(i=1; i<=n; i++)
t[i] = 0;
t[0] = 1;
for(i=1; i<=21; i++)
{
for(j=a[i]; j<=n; j++)
{
t[j] = t[j] + t[j-a[i]];
}
}
cout << t[n] << "\n";
}
int main()
{
for(int i=1;i<=21;i++)
a[i] = i*i*i;
ll n;
while(cin >> n)
{
need(n);
}
return 0;
}
Comments
Post a Comment