题解 2270: 蓝桥杯2016年第七届真题-四平方和

来看看其他人写的题解吧!要先自己动手做才会有提高哦! 
返回题目 | 我来写题解

筛选

暴力枚举!!!

摘要:```cpp #include using namespace std; int n; int main(){ cin >> n; for(int i = 0;……

暴力加适度优化

摘要:解题思路:    d和c从大数往小数循环注意事项:参考代码:#include <bits/stdc++.h> using namespace std; int main() { int ……

python-四平方和

摘要:解题思路:注意事项:参考代码:from math import sqrt         def f(n):       for i in range(int(sqrt(n))+1):   ……

蓝桥杯2016年第七届真题-四平方和-题解(C++代码)暴力及正解的两种解法

##这题有两种解法:1、暴力(但是容易被卡掉);2、二分###解题思路:1、暴力就是枚举a,b,c的值,然后求出d值,判断是否合法,合法就输出;2、预处理出两个数的平方和,然后再枚举两个数,就可以求出结果。**解法1(暴力)**```cpp#include#definexfirst#defineyse

枚举思想解决

摘要:解题思路:暴力枚举注意事项:参考代码:#include<stdio.h>#include<math.h>int main(){ int n,i,j,m,l; scanf("%d",&n);    in……