题目链接:http://acm.scu.edu.cn/soj/problem/4436/

题意:给你n个整数,求这n个数的平方根和是否是一个整数;

解题思路:如果这题每个数给他算出来,必然费时间,可能还会超精度,所以巧妙的方法就是判断这些整数是否全是完全平方数,如果有一个不是,则他们的平方根和肯定不是一个整数。

AC代码:

#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <iostream>
using namespace std;
int is(int x)
{
int y=sqrt(x);
if(y*y==x) return ;
return ;
}
int main()
{
int n;
while(scanf("%d",&n)!=EOF)
{
int f=;
for(int i=;i<n;i++)
{
int x;
scanf("%d",&x);
if(is(x)) f=;
}
if(f) puts("Yes");
else puts("No");
}
return ;
}

SCU 4436 Easy Math 2015年四川省赛题的更多相关文章

  1. 数学 SCU 4436 Easy Math

    题目传送门 /* 数学题:当有一个数开根号后是无理数,则No */ #include <cstdio> #include <algorithm> #include <cs ...

  2. scu 4436: Easy Math 水题

    4436: Easy Math Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.scu.edu.cn/soj/problem.actio ...

  3. SCU 4440 Rectangle 2015年四川省赛题

    题目链接:http://acm.scu.edu.cn/soj/problem/4440/ 题目大意:给一个n*m的方格,求周长小于等于k的矩形有多少个. 解题思路:我之前直接暴力,显然超时,所以后来发 ...

  4. scu oj 4442 Party(2015年四川省acm程序设计竞赛)

    Party n frogs are invited to a tea party. Frogs are conveniently numbered by 1,2,-,n. The tea party ...

  5. HDU 4727 The Number Off of FFF 2013年四川省赛题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4727 题目大意:队列里所有人进行报数,要找出报错的那个人 思路:,只要找出序列中与钱一个人的数字差不是 ...

  6. HDU 4722 Good Numbers 2013年四川省赛题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4722 题目大意:给定一个区间,求区间中有多少个满足每位上的数的和是10的倍数. 解题思路:先打表暴力求 ...

  7. HDU 4720 Naive and Silly Muggles 2013年四川省赛题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4720 题目大意:给你四个点,用前三个点绘制一个最小的圆,而这三个点必须在圆上或者在圆内,判断最一个点如 ...

  8. HDU 4716 A Computer Graphics Problem 2013年四川省赛题

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4716 题目大意不用解释了吧,看案例就能明白 #include<cstdio> #inclu ...

  9. 2015弱校联盟(1) -A. Easy Math

    A. Easy Math Time Limit: 2000ms Memory Limit: 65536KB Given n integers a1,a2,-,an, check if the sum ...

随机推荐

  1. 外部式css样式,写在单独的一个文件中

    外部式css样式(也可称为外联式)就是把css代码写一个单独的外部文件中,这个css样式文件以“.css”为扩展名,在<head>内(不是在<style>标签内)使用<l ...

  2. CoreMotion(加速计)

    加速计的作用 用于检测设备的运动(比如摇晃) 加速计的经典应用场景 摇一摇 计步器 ********************************** Core Motion获取数据的两种方式 pu ...

  3. 344. Reverse String(C++)

    344. Reverse String Write a function that takes a string as input and returns the string reversed. E ...

  4. 《du命令》-linux命令五分钟系列之三

    本原创文章属于<Linux大棚>博客. 博客地址为http://roclinux.cn. 文章作者为roc 希望您能通过捐款的方式支持Linux大棚博客的运行和发展.请见“关于捐款” == ...

  5. JQUERY 键盘事件

    一 一.首先需要知道的是: 1.keydown()keydown 事件会在键盘按下时触发. 2.keypress()keypress 事件会在敲击按键时触发,我们可以理解为按下并抬起同一个按键. 3. ...

  6. CentOS 6.8安装Python2.7.13

    查看当前系统中的 Python 版本 python --version 返回 Python 2.6.6 为正常. 检查 CentOS 版本 cat /etc/redhat-release 返回 Cen ...

  7. linux自动备份文件和数据库并上传到指定的远程FTP中

    直接把以下脚本复制到/root/backup.sh[root@lvtao.net ~]# chmod +x /root/backup.sh[root@lvtao.net ~]# crontab -e0 ...

  8. Vim的学习心得

    现在的工作是在unix平台,平时是用UE的ftp功能来写代码的,有时候文件大了,传输就很慢,而且经常不是很稳定.下定决心要学学Vim(现在应该没有人用原始的vi了吧),在经过二周的使用后,发现Vim实 ...

  9. centos jdk切换

        #这里找下载路径 http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html    ...

  10. Linux查看端口号

    查看端口占用情况的命令:lsof -i 查看某一端口的占用情况: lsof -i:端口号 结束占用端口的进程:killall 进程名 也可使用命令: netstat -apn|grep <端口号 ...