本文共 1534 字,大约阅读时间需要 5 分钟。
210300
1427
#include#include #include using namespace std;int dp[500];int main() { int n,m,i,k,j; while(cin>>k&&k) { memset(dp,0,sizeof(dp)); dp[0]=1; n=(int)sqrt(k*1.0); for(i=1;i<=n;i++) { for(j=i*i;j<=k;j++) { dp[j]+=dp[j-i*i]; } } cout< <
转载地址:http://gtfci.baihongyu.com/