提交时间:2026-06-19 15:58:58

运行 ID: 91917

#include <iostream> #include <cmath> using namespace std; bool check(int a) { for (int x = 1; x * x < a; ++x) { int s = a - x * x; int y = sqrt(s); if (y * y == s && y >= 1) { return true; } } return false; } int main() { int n; cin >> n; while (n--) { int a; cin >> a; if (check(a)) cout << "Yes" << endl; else cout << "No" << endl; } return 0; }