首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
首页
>
试题广场
>
平方和
[编程题]平方和
热度指数:2214
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 256M,其他语言512M
算法知识视频讲解
给定一个正整数 c ,请问是否存在正整数 a , b 满足
数据范围:
示例1
输入
5
输出
true
说明
2^2+1^2=5
示例2
输入
25
输出
true
说明
4^2+3^2=25
示例3
输入
24
输出
false
马上挑战
算法知识视频讲解
提交运行
算法知识视频讲解
添加笔记
求解答(0)
邀请回答
收藏(10)
分享
纠错
提交结果有问题?
14个回答
8篇题解
开通博客
在敲键盘的小冤种很喜欢吃蛋
发表于 2023-04-08 18:41:01
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return b
展开全文
牛客846498658号
发表于 2023-07-26 14:01:10
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return b
展开全文
Strive_C
发表于 2024-01-14 12:52:09
当c = 1时,输出false,题目没有要求a、b不能相等,所以当c = 2时,输出应为true /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ #include &
展开全文
牛客846498658号
发表于 2023-07-25 18:45:12
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return b
展开全文
在debug的牛牛很想退休
发表于 2023-04-09 22:27:19
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ #include <math.h> bool square(int c ) { int i, j;
展开全文
不用招呼我
发表于 2024-01-23 22:31:43
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */
展开全文
金字塔下的小蜗牛
发表于 2023-07-03 11:13:55
#include <cmath> class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @retu
展开全文
knuke
发表于 2022-10-30 22:48:11
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param c int整型 # @return bool布尔
展开全文
问题信息
模拟
穷举
基础数学
难度:
14条回答
10收藏
2284浏览
热门推荐
通过挑战的用户
查看代码
牛客45790...
2022-09-15 22:34:15
Jinjie0616
2022-09-14 17:39:40
牛客80527...
2022-09-13 21:48:58
牛客28368...
2022-09-12 23:30:53
皮卡皮卡皮卡皮卡丘
2022-09-12 22:01:02
相关试题
多少个点位于同一直线
穷举
Java工程师
C++工程师
iOS工程师
安卓工程师
运维工程师
前端工程师
算法工程师
PHP工程师
测试工程师
golang工程师
评论
(316)
来自
牛客考试系统测试卷
有两个文件context.txt和...
去哪儿
模拟
评论
(4)
一个10*10的矩阵(可以理解为棋...
去哪儿
模拟
评论
(0)
之前的经历中单品数据分析的经验丰富...
评论
(1)
什么样的人适合做数据分析
评论
(1)
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ public boolean square (int c) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ bool square(int c) { // write code here } };
#coding:utf-8 # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param c int整型 # @return bool布尔型 # class Solution: def square(self , c ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ public bool square (int c) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ function square( c ) { // write code here } module.exports = { square : square };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param c int整型 # @return bool布尔型 # class Solution: def square(self , c: int) -> bool: # write code here
package main import "fmt" /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ func square( c int ) bool { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ bool square(int c ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param c int整型 # @return bool布尔型 # class Solution def square(c) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ def square(c: Int): Boolean = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ fun square(c: Int): Boolean { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ public boolean square (int c) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ export function square(c: number): boolean { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ func square ( _ c: Int) -> Bool { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param c int整型 * @return bool布尔型 */ pub fn square(&self, c: i32) -> bool { // write code here } }
5
true
25
true
24
false