题意:
用1,8,27.....9261(都是n^3, 每个数都是无穷多个)从凑出n,有多少中不同的方案?
题解:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
long long DP[10000] = {1}; int n;
for (int i = 1, t; (t = pow(i, 3)) <= 10000; i++)
for (int j = t; j < 10000; j++) DP[j] += DP[j-t];
while ( cin >> n) cout << DP[n] << endl;
return 0;
}