class Solution {
public:
bool judgeSquareSum(int c) {
for (int a = 0; (long long)a * a <= c; ++a) {
int d = c - a * a;
int b = sqrt(d);
if (b * b == d) {
return true;
}
}
return false;
}
};