问题描述】
将 2019 拆分为若干个两两不同的完全平方数之和,一共有多少种不同的方
法?
注意交换顺序视为同一种方法,例如 132 + 252 + 352 = 2019 与 132 + 352 +
252 = 2019 视为同一种方法。
【答案提交】
这是一道结果填空的题,你只需要算出结果后提交即可。本题的结果为一
个整数,在提交答案时只填写这个整数,填写多余的内容将无法得分。
既然是结果填空题,就没有必要死太多脑细胞了,直接暴搜就行了,两种写法
#include <bits/stdc++.h>
using namespace std;
long long ans;
void dfs(int last,int sum)
{
if(sum>2019) return ;
if(sum==2019)
{
ans++;
return ;