1 条题解
-
0
#include <bits/stdc++.h> using namespace std; bool chk(int n){ for(int x=1; x*x<n; x++){ for(int y=1; y*y<=n; y++){ if(x*x + y*y == n) return true; } } return false; //所有方案都不行时,返回false } int main(){ int n,t; cin >> n; // while(n--){ cin >> t; if(chk(t)==true) cout << "Yes" << endl; else cout << "No" << endl; } // return 0; }
- 1
信息
- ID
- 608
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 8
- 标签
- (无)
- 递交数
- 96
- 已通过
- 16
- 上传者