NowCoderG:最大平方数
求不大于 N 的最大的平方数:

思路:输入数的平方根向下取整的数的平方即为所求。
Python代码:
import sys
import math num=int(sys.stdin.readline().strip())
num_sqrt=num ** 0.5 # 求平方根 target=math.floor((num_sqrt))** 2 # 平方根向下取整,再平方
print(target)

……
大神G... 都AK了啊
NowCoderG:最大平方数的更多相关文章
- Uva 11542 乘积是平方数
题目链接:http://vjudge.net/contest/142484#problem/A 这个题目也是2016年CCPC网赛上面的题目,当时我是不会做的,但是大牛们都知道这是一个原题,最后给一队 ...
- 人活着系列之平方数 分类: sdutOJ 2015-06-22 17:10 7人阅读 评论(0) 收藏
人活着系列之平方数 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 偶然和必然?命运与意志?生与死?理性与情感?价值与非价值?在&quo ...
- 洛谷P1206 [USACO1.2]回文平方数 Palindromic Squares
P1206 [USACO1.2]回文平方数 Palindromic Squares 271通过 501提交 题目提供者该用户不存在 标签USACO 难度普及- 提交 讨论 题解 最新讨论 暂时没有 ...
- Project Euler 92:Square digit chains 平方数字链
题目 Square digit chains A number chain is created by continuously adding the square of the digits in ...
- Project Euler 98:Anagramic squares 重排平方数
Anagramic squares By replacing each of the letters in the word CARE with 1, 2, 9, and 6 respectively ...
- BZOJ2440(全然平方数)二分+莫比乌斯容斥
题意:全然平方数是指含有平方数因子的数.求第ki个非全然平方数. 解法:比較明显的二分,getsum(int middle)求1-middle有多少个非全然平方数,然后二分.求1-middle的非全然 ...
- [LeetCode] Sum of Square Numbers 平方数之和
Given a non-negative integer c, your task is to decide whether there're two integers a and b such th ...
- C#版 - Leetcode 633. 平方数之和 - 题解
版权声明: 本文为博主Bravo Yeung(知乎UserName同名)的原创文章,欲转载请先私信获博主允许,转载时请附上网址 http://blog.csdn.net/lzuacm. C#版 - L ...
- Uva 12009 平方数尾数与自身同样 dfs 构造
版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/qq574857122/article/details/25166611 题目链接:点击打开链接 题意 ...
随机推荐
- hdu 3340 Rain in ACStar 线段树区间等差数列更新
Rain in ACStar Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/problem/show/1385 ...
- hdu4337 King Arthur's Knights
King Arthur's Knights Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
- HDU 4579 Random Walk (解方程组)
Random Walk Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 65535/65536 K (Java/Others)Total ...
- Spring MVC表单处理
以下示例演示如何编写一个简单的基于Web的应用程序,它使用Spring Web MVC框架使用HTML表单. 首先使用Eclipse IDE,并按照以下步骤使用Spring Web Framework ...
- XmlReader/XmlWriter 类
XmlReader用于读取Xml文件,XmlWriter用于将数据写到Xml文件.其实,在印象当中,XML很多的操作类都支持直接Save.Read也支持接受XmlReader与XmlWriter类的示 ...
- 解决IIS 不能下载.exe.config文件的方法
IIS允许下载".config"文件 Config文件是web的配置文件,默认是不允许下载的,就算在MIME中配置“application/octet-stream”,也是下载不了 ...
- 【Unicode编码表】UniCode编码表+转化器
UniCode编码表[转载:https://www.cnblogs.com/csguo/p/7401874.html] Unicode编码则是采用双字节16位来进行编号,可编65536字符,基本上包含 ...
- 3D打印
R=2.5的内径圆,需要R=2.2的圆柱才能吻合,否则插不进去.
- Python学习(四)数据结构 —— str
Python 字符串 str 本章大致介绍了 Python 的字符串类型 str,包括字符串的赋值及转义.字符串运算符.字符串格式化输出 以及 一些字符串的内建函数等. 字符串赋值及转义 我们可以使用 ...
- iOS开源项目:JSONKit
一个Json解析库,其特点是代码简单,只有一个.h和.m文件. https://github.com/johnezang/JSONKit JSON(JavaScript Object Notation ...