| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 91917 | sh25_shenpy | 202406-GESP-二级-平方之和 | C++ | 通过 | 0 MS | 252 KB | 508 | 2026-06-19 15:58:58 |
#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; }