Problem:


Score : 200 points

Problem Statement

Find the largest square number not exceeding N. Here, a square number is an integer that can be represented as the square of an integer.

Constraints

1 \leq N \leq 10^9

N is an integer.

Input

Input is given from Standard Input in the following format:

N

Output

Print the largest square number not exceeding N.

Sample Input 1

10

Sample Output 1

9

10 is not square, but 9 = 3 × 3 is. Thus, we print 9.

Sample Input 2

81

Sample Output 2

81

Sample Input 3

271828182

Sample Output 3

271821169



Sample input:
10


Sample output:
9

Submission status: Time Limit Exceeded

Solution code:
import math

n=int(input())
for i in range(int(math.sqrt(n))):
    while (i+1)**2 < n:
        pass
print((i+1)**2)

Submission status: Time Limit Exceeded

Solution code:
import math

n=int(input())
k=0
for i in range(int(math.sqrt(n))):
    while (i+1)**2 < n:
        k+=1
print((k+1)**2)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
k=0
for i in range((n+1)//2):
    while (i+1)**2 < n:
        k+=1
print((k+1)**2)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
k=0
for i in range(n):
    while (i+1)**2 < n:
        k+=1
print((k+1)**2)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
k=0
for i in range(10**5):
    while (i+1)**2 < n:
        k+=1
print((k+1)**2)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
k=0
for i in range(10**9):
    while (i+1)**2 < n:
        k+=1
print((k+1)**2)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans=1
for i in range(n+1):
    if i**2<=n:
        ans=i**2

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

a = 1

while a <= n:
  b = a
  a **= 2
  
print(b)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
for i in range(1,N+1):
    if i*i <= N:
        ans = max(ans,i*i)
    #else:
        #break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
l = (x if isSquare(x) else -1 for x in range(1,N+1))
print(max(l))

Submission status: Time Limit Exceeded

Solution code:
def isSquare(x):
  f = 1
  while f * f <= x:
    if f * f == x:
      return True
    else:
      f += 1
  return False

N = int(input())
f = N
while True:
  if isSquare(f):
    print(f)
    exit()
  f -= 1

Submission status: Time Limit Exceeded

Solution code:
def isSquare(x):
  f = 1
  while f * f <= x:
    if f * f == x:
      return True
    else:
      f += 1
  return False

N = int(input())
print(max(x if isSquare(x) else 0 for x in range(1,1+N)))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
M=1
for i in range(1,N):
    for j in range(2,N):
        if i**j<= N:
            M = max(M,i**j)
        else:
            break
print(M)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

x=0
while 1:
  if x**2>n:
    print((x-1)**2)
  x+=1

Submission status: Time Limit Exceeded

Solution code:
import math
N = int(input())
result = 0
for i in range(N + 1):
    if math.sqrt(i).is_integer() is True:
        result = i

print(result)

Submission status: Time Limit Exceeded

Solution code:
import math
N = int(input())
A = 81
result = 0
for i in range(N + 1):
    if math.sqrt(i).is_integer() is True:
        result = i

print(result)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
for i in range(n):
    for j in range(n):
        if (i+1) / (j+1) == j+1:
            ans = i + 1
            break
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
for i in range(n):
    for j in range(n):
        if (i+1) / (j+1) == j+1:
            ans = i + 1
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
a = 0
for i in range(1, n+1):
    if i % (i**0.5) == 0:
        if i > a:
            a = i
print(a)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 1
while ans**2 <= n:
    if ans**2 < n: ans += 1
print((ans-1)**2)

Submission status: Time Limit Exceeded

Solution code:
import sys
import math
import bisect

def solve(n):
    ans = 0
    for i in range(n + 1):
        if i ** 2 <= n:
            ans = i ** 2
    return ans

def main():
    n = int(input())
    print(solve(n))

if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
l = []
for i in range(1, n + 1):
    if math.sqrt(i) % 1 == 0:
        l.append(i)
print(max(l))

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
ans=1
for i in range(n):
    if i**2<=n and i**2 > ans:
        ans=i**2
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n =int(input())

ans =[]
for i in range(1,n+1):
  if (i ** 0.5).is_integer() and i <= n:
    ans.append(i)
    
ans.sort()    
print(ans[-1])

Submission status: Time Limit Exceeded

Solution code:
n =int(input())

ans =[]
for i in range(10**9):
  if i > n:
    break
  
  if (i ** 0.5).is_integer() and i <= n:
    ans.append(i)
    
    
print(ans[-1])

Submission status: Time Limit Exceeded

Solution code:
n =int(input())

ans =[]
for i in range(10**9):
  if (i ** 0.5).is_integer() and i <= n:
    ans.append(i)
    
    
print(ans[-1])

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

x = 0
for i in range(n+1):
    if (i**0.5) == int(i**0.5):
        x = i

print(x)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
s = 1
for i in range(1,n):
    for j in range(2,n):
        if i ** j <= n : s = max(s,i**j)
        else: break
print(s)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
import math
ma=1
for i in range(1,n+1):
    x=math.sqrt(i)
    if x.is_integer():
        ma=max(ma,i)
    else:
        continue
print(ma)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
i=1
while(True):
  if (i+1)**2<=n:
    i+=1
print(i**2)

Submission status: Time Limit Exceeded

Solution code:


import numpy as np

n=int(input())
for i in range(10**9):
    if(i*i>n):
        print((i-1)**2)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
heihou = [i ** 2 for i in range(N+1) if i**2 <= N]
print(heihou[-1])

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

for n in range(1, N + 1)[::-1]:
    if n * n <= N:
        print(str(n * n))
        break
    else:
        pass

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
c=1
for i in range(1,n):
    for j in range(2,n):
        if i**j<=n:
            c=max(c,i**j)
        else:
            break
print(c)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
ans = 0
for i in range(1,n+1):
    if math.sqrt(i).is_integer():
        ans = max(ans,math.sqrt(i))
print(int(ans**2))

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
 
for i in range(1,n+1):
  if i**2 <= n:
    ans = i**2
 
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for i in range(1, n+1):
    if (i **.5).is_integer():
        ans = i
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import math

# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    ans = 1
    
    for i in range(N+1):
        tmp = math.sqrt(i)
        if tmp.is_integer():
            ans = i
            
    print(ans)
            	
if __name__ == "__main__":
	main()

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0
for i in range(1,n+1):
    if i ** 2 <= n:
        ans = i**2
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
li=[]
for i in range(1, n+1):
  if (i ** .5).is_integer():
    li.append(i)
print(max(li))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for i in range(1, N+1):
  if int(i**0.5)**2 == i:
    ans = i
print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
for i in range(1, N+1):
  if int(i**0.5)**2 == i:
    ans = i
print(ans)

Submission status: Time Limit Exceeded

Solution code:
# 入力
N=int(input())

a=1
while True:
  b=a*a
  
  if N==b:
    print(b)
    break
  
  elif N<b:
    print((a-1)*(a-1))
    break

Submission status: Time Limit Exceeded

Solution code:
import bisect
x = int(input())
arr = [i**2 for i in range(1,x+1) if i**2 <= x]
ans = bisect.bisect_right(arr, x)
print(arr[ans-1])

Submission status: Time Limit Exceeded

Solution code:
n=int(input())
for i in range(10**9):
    if i**2>n:print((i-1)**2)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 1

n = 1
while n * n <= N:
  ans = n * n

print(ans)

Submission status: Time Limit Exceeded

Solution code:
#2
n = int(input())
a = 0
for i in range(1, n+1):
    if i**2 <= n:
        a = i**2
    else: continue
print(a)

Submission status: Time Limit Exceeded

Solution code:
#2
n = int(input())
a = list()
for i in range(1,n + 1):
    if i**2 <= n:
        a = a + [i]
    else : 
        break
print(int(a[-1])**2)

Submission status: Time Limit Exceeded

Solution code:
#2
k = 0
x = int(input())
for y in range(0, x+1):
    y = y*y
    if y <= x:
        k = y
print(k)

Submission status: Time Limit Exceeded

Solution code:
#2
n = int(input())
m = 0
for i in range(n+1) :
    if i**2<=n :
        m=i**2
print(m)

Submission status: Time Limit Exceeded

Solution code:
#2
n = int(input())
m=0
for i in range(1,n+1) :
    for j in range(1,i+1) :
        if j**2==i :
            m=i    
print(m)

Submission status: Time Limit Exceeded

Solution code:
#2
n = int(input())
m = 0
for i in range(0,n+1) :
    if m <= i*i <= n :
        m = i*i
print(m)

Submission status: Time Limit Exceeded

Solution code:
#2
n = int(input())
number = 0
for i in range(n+1) :
    if i**2 <= n :
        number = i**2
print(number)

Submission status: Time Limit Exceeded

Solution code:
print(max(filter(lambda x:x**(1/2)%1==0,range(1,int(input())+1))))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 0
for i in range(1, N + 1):
	if i ** 2 <= N and i ** 2 >= ans:
		ans = i * i
print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
x = n
while x * x > n :
    x = x - 1
    
print(x*x)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
num = 0
for i in range(n,0,-1):
    num = math.sqrt(i)
    if len(list(str(num))) == 3:
        print(i)
        break
    else:
        pass

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
x=1
if(N>1):
 for i in range(N+1):
  for j in range(int(i/5)):
   if(i==j*j):
    x=i
if(4<=N<=8):
 x=4
if(9<=N<=15):
 x=9
if(16<=N<=24):
 x=16
if(25<=N<=35):
 x=25
print(x)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
x=1
if(N>1):
 for i in range(N+1):
  for j in range(int(i/2)):
   if(i==j*j):
    x=i
if(4<=N<=8):
 x=4
print(x)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
x=1
for i in range(N+1):
 for j in range(i+1):
  if(i==j*j):
   x=i
print(x)

Submission status: Time Limit Exceeded

Solution code:
def Sqrt(x, e=0.0001):
    p = 0.0
    q = x
    while abs(q - p) > e:
        p = q
        q = p - (p*p - x)/(2.*p)
    return q

N=int(input())
a=0
b=0
x=1
for i in range(N+1):
  a=Sqrt(i)
  b=100*a
  c=int(b/100)
  if(i==c*c):
    x=i
print(x)

Submission status: Time Limit Exceeded

Solution code:
N=int(input())
a=0
b=0
x=0
for i in range(N+1):
  a=i**0.5
  b=int(a)
  if(i==b*b):
   x=i
print(x)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
n=int(input())
for i in range(int(np.sqrt(n)),n+1):
    if np.sqrt(i)==int(np.sqrt(i)): a=i
print(a)

Submission status: Time Limit Exceeded

Solution code:
import numpy as np
n=int(input())
for i in range(1,n+1):
    if np.sqrt(i)==int(np.sqrt(i)): a=i
print(a)

Submission status: Time Limit Exceeded

Solution code:
import math
N=int(input())
a=0
b=0
x=0
for i in range(N+1):
  a=math.sqrt(i)
  b=int(a)
  if(i==b*b):
   x=i
print(x)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
N=int(input())
maxi=0
for i in range(1,N+1):
    if pow(i,2)<=N:
        maxi=pow(i,2)
print(maxi)

Submission status: Accepted

Solution code:
n=int(input())
print(int(n**0.5)**2)

Submission status: Accepted

Solution code:
print(int(int(input())**.5)**2)

Submission status: Accepted

Solution code:
n=int(input())

ans=1
while (ans+1)**2<=n:
    ans+=1
print(ans**2)

Submission status: Accepted

Solution code:
N = int(input())
print(int(N**.5)**2)

Submission status: Accepted

Solution code:
import math


def answer(n: int) -> int:
    return int(math.sqrt(n)) ** 2


def main():
    n = int(input())
    print(answer(n))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
x=int(input())
y= math.sqrt(x)
z= y//1
a=z**2
print(int(a))

Submission status: Accepted

Solution code:
N = int(input())
print(int(N**(1/2))**2)

Submission status: Accepted

Solution code:
n = int(input())
print(int(n**.5) ** 2)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(100000):
  if n >= (10**5-i)**2:
    print((10**5-i)**2)
    exit()

Submission status: Accepted

Solution code:
n = int(input())
for i in range(1,n+2):
    if i*i > n:
        print((i-1)*(i-1))
        exit()

Submission status: Accepted

Solution code:
def multiple(n):
    a = []
    for i in range(1,int(n**.5)+1):
        a.append(i*i)
    return a
n = int(input())
a = multiple(n)
ans = 10**18
for i in a:
    if n-i < 0:
        continue
    ans = min(ans,abs(n-i))
print(n-ans)

Submission status: Accepted

Solution code:
N = int(input())
i = 1
if N == 1:
    print(i)
else:
    while i <= N:
        if((i * i) > N):
            print((i-1) * (i-1))
            break
        i += 1

Submission status: Accepted

Solution code:
print(int(int(input()) ** 0.5) ** 2)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(100001):
    if i **2 <= n:
        ans = i**2
    
print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
print(math.floor(math.sqrt(n)) ** 2)

Submission status: Accepted

Solution code:
n=int(input())
ans=1
for i in range(1,n+2):
  if i**2 > n:
    print(ans**2)
    break
  ans = i

Submission status: Accepted

Solution code:
N = int(input())
ans = 1
for i in range(1, N):
    if i*i > N:
        break
    ans = max(ans, i*i)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
k = 1
while k ** 2 <= n:
  ans = k ** 2
  k += 1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

ans=1
loop = 3
for i in range (1,100000):
        if i**2 <= n:
                ans=i**2
        
        

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
p = int(n**0.5)
a = 1
ans = 1
while a<=p:
    if a**2 <=n:
        ans = max(ans,a**2)
    a +=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 0
for i in range(10**5):
    if i**2<=n:
        ans = i**2
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
from math import sqrt, floor
for i in range(1,floor(sqrt(N))+2):
    if i**2 > N:
        print((i-1)**2)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(1, n):
    if i**2 > n:
        print((i-1)**2)
        break
else:
    print(1)

Submission status: Accepted

Solution code:
n=int(input())
for i in range(1,10**5+2):
  if i**2>n:print((i-1)**2);exit()

Submission status: Accepted

Solution code:
print(int(int(input())**0.5)**2)

Submission status: Accepted

Solution code:
import math
n = int(input())
print(int(math.sqrt(n))**2)

Submission status: Accepted

Solution code:
print(int(int(input())**0.5)**2)

Submission status: Accepted

Solution code:
import math
N = int(input())

ans = 1
for i in range(1,math.floor(math.sqrt(N))+1):
  if i * i <= N:
    ans = i * i
    
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
print(int(sqrt(N)) ** 2)

Submission status: Accepted

Solution code:
n = int(input())

i=1
while i*i <= n:
    ans = i*i
    i+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(100000):
  if i**2 > n:
    print((i-1)**2)
    break

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    a = 1
    i = 0
    prev = 0
    while a <= N:
        i += 1
        prev = a
        if a > N:
            break
        else:
            a = i * i
    print(prev) 
main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())

    print(int(n ** 0.5) ** 2)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

for i in range(1, 10**9):
  if i**2 == N:
    print(i**2)
    break
  elif i**2 > N:
    print((i-1)**2)
    break

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in range(1, 10 ** 5):
    if i ** 2 <= n:
        ans = i ** 2

print(ans)

Submission status: Accepted

Solution code:
#ABC077B
n = int(input())
while n>0:
    tmp = n**(1/2)
    if(tmp==int(tmp)):
        print(n)
        break
    n-=1

Submission status: Accepted

Solution code:
n = int(input())


ans = 1
for i in range(1, n):
  if i**2 > n:
    ans = (i-1)**2
    break


print(ans)

Submission status: Accepted

Solution code:
N = int(input())
print(int(N**0.5)**2)

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())

    i = 0
    while (i + 1) ** 2 <= N:
        i += 1
    print(i ** 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def main():
    n = input_int()
    print(int(n**0.5)**2)
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import sqrt

n = int(input())

ans = int(sqrt(n))

if (ans + 1) * (ans + 1) <= n:
    print((ans + 1) * (ans + 1))
elif ans * ans <= n:
    print(ans * ans)
else:
    print((ans - 1) * (ans - 1))

Submission status: Accepted

Solution code:
from math import sqrt

n = int(input())
print(int(sqrt(n)) ** 2)

Submission status: Accepted

Solution code:
N = int(input())
for i in range(1, N+1):
    if i*i > N:
        print((i-1)*(i-1))
        exit()
print(1)

Submission status: Accepted

Solution code:
n = int(input())
ans=1
for i in range(n+1):
    if i**2<=n:
        ans=i**2
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
import math

N=int(input())
n=math.floor(math.sqrt(N))**2

print(n)

Submission status: Accepted

Solution code:
n=int(input())
i=1
tmp=1
while True:
  if i**2<=n:
    tmp=i**2
  else:
    break
  i+=1
print(tmp)

Submission status: Accepted

Solution code:
n = int(input())
print(int(n ** 0.5) ** 2)

Submission status: Accepted

Solution code:
n=int(input())
i=1
tmp=1
while True:
  if i**2 <= n:
    tmp = i**2
  else:
    break
  i += 1
print(tmp)

Submission status: Accepted

Solution code:
n = int(input())
print(int(n**0.5)**2)

Submission status: Accepted

Solution code:
N=int(input())
C=0
if N==1:
  print(1)
  exit()
for i in range(1,N):
  if i**2<N:
    C=i**2
  elif i**2==N:
    C=i**2
    break
  elif i**2>N:
    break
print(C)

Submission status: Accepted

Solution code:
import math
s = int(input())
z = math.sqrt(s) // 1
print(int(z**2))

Submission status: Accepted

Solution code:
N=int(input())
import math
print((int(math.sqrt(N)))**2)

Submission status: Accepted

Solution code:
N=int(input())
if N==1 :
  print(1)
  exit()
for i in range(1,N+1) :
  if i*i>N :
    print((i-1)*(i-1))
    exit()

Submission status: Accepted

Solution code:
n = int(input())
while (n ** 0.5) % 1 != 0:
    n -= 1
print(n)

Submission status: Accepted

Solution code:
a=int(input())
i=0
while i**2<=a:
  i=i+1
print((i-1)**2)

Submission status: Accepted

Solution code:
N = int(input())

from math import floor, sqrt
ans = floor(sqrt(N))**2
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
print(int(N**(1/2))**2)

Submission status: Accepted

Solution code:
n = int(input())
c = 1
for i in range(10**5):
    if i**2 <= n:c = i**2
    else:break
print(c)

Submission status: Accepted

Solution code:
n=int(input())

for i in range(10**5):
    if i**2 > n:
        print((i-1)**2)
        break

Submission status: Accepted

Solution code:
n = int(input())
for i in range(100000):
    if(i**2 > n):
        print((i-1)**2)
        exit()

Submission status: Accepted

Solution code:
import math
a=int(input())
b=math.sqrt(a)
n=math.ceil(b)
m=math.floor(b)
print(m**2)

Submission status: Accepted

Solution code:
import sys
N=int(input())
if N==1:
    print("1")
elif N==2:
    print("1")
else:
    for i in range(N):
        if i**2>N:
            print((i-1)**2)
            sys.exit()
        else:
            pass

Submission status: Accepted

Solution code:
x = int(input())
for i in range(10**5):
  if i**2>x:
    a=((i-1)**2)
    break
print(a)

Submission status: Accepted

Solution code:
n=int(input())
x=n**0.5
print(int(x)**2)

Submission status: Accepted

Solution code:
N=int(input())
print(int(N**(1/2)//1)**2)

Submission status: Accepted

Solution code:
print(int(int(input()) ** .5) ** 2)

Submission status: Accepted

Solution code:
import math
n = int(input())
print(int(math.sqrt(n)) * int(math.sqrt(n)))

Submission status: Accepted

Solution code:
n = int(input())
for i in range(int(n**0.5)+1):
    if i*i <= n:
        ans = i*i
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
print(math.floor(math.sqrt(n))**2)

Submission status: Accepted

Solution code:
N = int (input ())
x = 1
while x**2 <= N:
  x += 1
x -= 1
print (x**2)

Submission status: Accepted

Solution code:
N = int(input())
print(int(N**(0.5))**2)

Submission status: Accepted

Solution code:
N=int(input())
for i in range(int(N**0.5)+1):
    if N>=i**2:
        ans=i**2
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

for i in range(1, 10**5):
    p = i**2
    if p > n:
        print((i-1)**2)
        break

Submission status: Accepted

Solution code:
print(int(int(input())**.5)**2)

Submission status: Accepted

Solution code:
from math import sqrt

n = int(input())

for i in range(int(sqrt(n) + 1)):
    if i ** 2 <= n:
        ans = i ** 2
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())

ans = 0
for i in range(1, 10**5):
    n = i ** 2
    if n <= N:
        ans = n
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
n= int(input())

for i in range(n,-1,-1):
  if (i**0.5).is_integer():
    print(i)
    break

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
max = int(n**0.5)+1
for i in range(1, max, 1):
    tmp = i**2
    if tmp <= n:
        ans = tmp
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = 1
for i in range(2, 10**5):
    if i*i <= n:
        ans = i*i
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
n=int(input())
for i in range(1,int(sqrt(n))+1):
  if i**2>n:
    print((i-1)**2)
    break
else:
  print(i**2)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    ans = int(N ** 0.5) ** 2
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
print(int(int(input())**0.5//1)**2)

Submission status: Accepted

Solution code:
import math
n = int(input())
tmp = int(math.sqrt(n))
print(tmp**2)

Submission status: Accepted

Solution code:
from math import sqrt
n = int(input())
print(int(sqrt(n))**2)

Submission status: Accepted

Solution code:
n = int(input())
print((int(n**(1/2)))**2)

Submission status: Accepted

Solution code:
import math
print(int(math.sqrt(int(input())))**2)

Submission status: Accepted

Solution code:
n = int(input())
print(int(n ** 0.5) ** 2)

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
a = int(n**0.5)
print(a**2)

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n, 0, -1):
  j = int(i ** 0.5)
  if int(j) ** 2 == i:
    break
print(i)

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 0
for i in range(int(math.sqrt(N))+1):
  if i * i <= N:
    ans = i*i
print(ans)

Submission status: Accepted

Solution code:
import math
N=int(input())
ans=N
for i in range(N):
  if math.sqrt(ans).is_integer():
    print(ans)
    break
  ans-=1

Submission status: Accepted

Solution code:
import math
N=int(input())
c=int(math.sqrt(N))
print(c**2)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()


def main():
    n = int(input())
    ans = 1
    while ans ** 2 <= n: ans += 1
    print((ans - 1) ** 2)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
print(int((N**(1/2)//1)**2))

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]
#a = [int(input()) for _ in range(n)]

n = int(input())

ans = 1
for i in range(1,n+1):
    if (i*i > n):
        ans =  (i-1)**2
        break
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
if int((N+1)**.5)**2==N:print(N)
else:print(int(N**.5)**2)

Submission status: Accepted

Solution code:
import math
N = int(input())
for i in range(N):
  x = N - i
  if int(math.sqrt(x)) == math.sqrt(x):
    print(x)
    break

Submission status: Accepted

Solution code:
N=int(input())
ans=1
for i in range(N+1):
    if i*i<=N:
        ans=i
    else:
        break
print(ans**2)

Submission status: Accepted

Solution code:
k,n = 0,int(raw_input())

while(k * k <= n): k+=1
print (k-1) ** 2

Submission status: Accepted

Solution code:
import math
n = int(input())
for i in reversed(range(0,n + 1)):
    if (i ** .5).is_integer():
        print(i)
        break

Submission status: Accepted

Solution code:
N = int(input())
SqN = 1
while True:
    if SqN**2>N:
        print((SqN-1)**2)
        break
    SqN += 1

Submission status: Accepted

Solution code:
n = int(input())
j = 0
while j**2<=n:
    j += 1
print((j-1)**2)

Submission status: Accepted

Solution code:
n=int(input())
i=1
while i*i<=n:
    i+=1
i=i-1
print(i*i)

Submission status: Accepted

Solution code:
N=int(input())
print((int(N**(1/2)))**2)

Submission status: Accepted

Solution code:
N = int(input())

print((int(N**(1/2)))**2)

Submission status: Accepted

Solution code:
n=int(input())
for x in range(10**5):
  if x**2>n:
    print((x-1)**2)
    break

Submission status: Accepted

Solution code:
n=int(input())
print(int(n**(1/2))**2)

Submission status: Accepted

Solution code:
n = int(input())
cnt = 1
ans = 0
while 1:
    tmp = cnt ** 2
    if tmp <= n:
        ans = tmp
        cnt += 1
    else:
        break

print(ans)

Submission status: Accepted

Solution code:
# # Make IO faster
# import sys
# input = sys.stdin.readline

# # get single (or) multiple str
# X = input()

# # get single int
# N = int(input())
# # get multiple int (e.g., 2)
# X, Y = map(int, input().split())
# # get multiple int (e.g., 2) for N lines
# XY = [list(map(int, input().split())) for _ in range(N)]

# from IPython import embed; embed(); exit();

# 全部入り
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

import math
N = INT()
m = int(math.sqrt(N))
print(m ** 2)

Submission status: Accepted

Solution code:
N = int(input())

import math
ans = 1
for i in range(1,int(math.sqrt(N))+2,1):
    if i*i<=N:
        ans = i*i

print(ans)

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N = int(readline())

    n = 1
    while (n + 1) * (n + 1) <= N:
        n += 1

    print(n * n)

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n=int(input())
print(int(math.sqrt(n))**2)

Submission status: Accepted

Solution code:
import math

N=int(input())
print(int(math.sqrt(N))**2)

Submission status: Accepted

Solution code:
n = int(input())
 
a = 1
b = 0
c = 0

 
while c <= n:
  b = c
  c = a ** 2
  a += 1
  
print(b)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for i in range(1,N+1):
    if i*i <= N:
        ans = max(ans,i*i)
    else:
        break
print(ans)

Submission status: Accepted

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())

print(int(I()**.5)**2)

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(10000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy

if __name__ == "__main__":
    n = int(input())
    print(int(n**0.5)**2)

Submission status: Accepted

Solution code:
N = int(input())

for i in range(1, 10**9):
  if i ** 2 > N:
    print((i - 1) ** 2)
    exit()

Submission status: Accepted

Solution code:
N=int(input())
for i in range(N,0,-1):
    if i**0.5%1==0:
        print(i)
        exit()

Submission status: Accepted

Solution code:
def isSquare(x):
  return x == round(x**(1/2))**2

N = int(input())
f = N
while True:
  if isSquare(f):
    print(f)
    exit()
  else:
    f -= 1

Submission status: Accepted

Solution code:
N = int(input())
ans = 1
while ans * ans <= N:
    ans += 1
ans -= 1
print(ans * ans)