304794: CF914A. Perfect Squares
Memory Limit:256 MB
Time Limit:1 S
Judge Style:Text Compare
Creator:
Submit:0
Solved:0
Description
Perfect Squares
题意翻译
给定一组有n个整数的数组a1,a2,…,an.找出这组数中的最大非完全平方数。 完全平方数是指有这样的一个数x,存在整数y,使得x=$y^2$. ### 输入格式 第一行输入一个单独的整数n(1<=n<=1000 ),n为该组数的数量。 接下来有n个整数,a1,a2,an(-10^6<=a<=10^6) 数据保证至少存在一个整数是非完全平方数。题目描述
Given an array $ a_{1},a_{2},...,a_{n} $ of $ n $ integers, find the largest number in the array that is not a perfect square. A number $ x $ is said to be a perfect square if there exists an integer $ y $ such that $ x=y^{2} $ .输入输出格式
输入格式
The first line contains a single integer $ n $ ( $ 1<=n<=1000 $ ) — the number of elements in the array. The second line contains $ n $ integers $ a_{1},a_{2},...,a_{n} $ ( $ -10^{6}<=a_{i}<=10^{6} $ ) — the elements of the array. It is guaranteed that at least one element of the array is not a perfect square.
输出格式
Print the largest number in the array which is not a perfect square. It is guaranteed that an answer always exists.
输入输出样例
输入样例 #1
2
4 2
输出样例 #1
2
输入样例 #2
8
1 2 4 8 16 32 64 576
输出样例 #2
32