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: Accepted

Solution code:
#!/usr/bin/env python3
import sys


def solve(N: int):
    lb = 0
    ub = N + 1
    while lb + 1 < ub:
        m = (lb + ub) // 2
        if m * m > N:
            ub = m
        else:
            lb = m
    print(lb * lb)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(1000001):
    if i**2>N:
        break

print((i-1)**2)

Submission status: Accepted

Solution code:
import math


a=int(input())

print((int(a**(0.5)))**2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#dbvDSbvdIvdbidvbdibvdibvdi


print(int(float(int(input())**0.5))**2)

Submission status: Accepted

Solution code:
import sys
def fastio():
    from io import StringIO
    from atexit import register
    global input
    sys.stdin = StringIO(sys.stdin.read())
    input = lambda : sys.stdin.readline().rstrip('\r\n')
    sys.stdout = StringIO()
    register(lambda : sys.__stdout__.write(sys.stdout.getvalue()))
fastio()

INF = 10**20
MOD = 10**9 + 7
I = lambda:list(map(int,input().split()))
# from math import gcd
from math import ceil
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br

n, = I()
print(int(n ** 0.5) ** 2)

Submission status: Accepted

Solution code:
a=[i**2 for i in range(100000)]
n=int(input())
for i in range(len(a)):
    if n<a[i]:
        print(a[i-1])
        exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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))
        break

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter


def readints():
    return list(map(int, input().split()))


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,1000001):
    t=i*i
    if t<=n:
        ans=t
    else:
        print(ans)
        exit()

Submission status: Accepted

Solution code:
N=int(input())

for N in range(N,0,-1):
  a=int(N**0.5)
  if a**2==N:
    print(N)
    break

Submission status: Accepted

Solution code:
import math
n=float(input())
m=math.floor(math.sqrt(n))
print(m*m)

Submission status: Accepted

Solution code:
n = int(input())

ans = int(n**(1/2))

print(ans*ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

print(int(math.floor(n**0.5))**2)

Submission status: Accepted

Solution code:
y = int(input())
p = (pow(y , 0.5))
print(pow(int(p) , 2))

Submission status: Accepted

Solution code:
import math
def is_integer(n):
    try:
        float(n)
    except ValueError:
        return False
    else:
        return float(n).is_integer()


l = int(input())
if is_integer(math.sqrt(l)):
    print(l)
else:
    for i in range(l):
        l=l-1
        if is_integer(math.sqrt(l)):
            print(l)
            break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

for i in range(n):
    sqrt = int(math.sqrt(n-i))
    if(sqrt**2 == (n-i)):
        print(n-i)
        break

Submission status: Accepted

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

Submission status: Accepted

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

for i in range (n,0,-1):
    ans= math.sqrt(i)
    sq= int(ans)
    sq=float(sq)
    #print(ans,sq)
    if sq==ans:
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math
a=int(input())
c=int(pow(a,0.5))
print(c**2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

k = math.floor(math.sqrt(n))
print(k*k)

Submission status: Accepted

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

x= int(math.sqrt(x))
print(x*x)

Submission status: Accepted

Solution code:
import math
n = int(input())
while(n>0):
  r = int(math.sqrt(n))
  if(r*r == n):
    print(n)
    exit()
  else:
    n-=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

i = int(input())

r = math.sqrt(i)

ir = int(r)

print(ir*ir)

Submission status: Accepted

Solution code:
import math

n = int(input())

while (math.sqrt(n)-float(math.floor(math.sqrt(n))))!=0.0:
    n = n-1

print(n)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n=int(input())
if n==0:
    print(0)
    exit(0)
l1=[i*i for i in range(int(math.sqrt(n))+1)]
print(l1[-1])

Submission status: Accepted

Solution code:
import sys

n=int(input())
x=1
while 1:
  tmp=(x+1)*(x+1)
  if tmp > n:
    print(x*x)
    sys.exit()
  x+=1

Submission status: Accepted

Solution code:
n = int(input())
for i in range(n, 0, -1):
    if (i**0.5).is_integer():
        print(i)
        break

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
from math import sqrt
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    print(int(sqrt(N))**2)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
ans = -1*float('inf')
while N >= 1:
  if (N**0.5)%2 == 1 or (N**0.5)%2 == 0:
    ans = max(ans, N)
    break
  N -= 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
import math

n = int(input())
sq_n = math.sqrt(n)
x = int(sq_n)
print(x*x)

Submission status: Accepted

Solution code:
import math
N = int(input())
  
while True:
  if int(math.sqrt(N)) ** 2 == N:
    print(N)
    exit()
  N -= 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())
i = 0
while i <= n:
	if i**2 > n:
		break
	m = i**2
	i = i + 1

print(m)

Submission status: Accepted

Solution code:
#abc077 b
import math 
n=int(input())
m=int(math.sqrt(n))
print(m*m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n,0, -1):
    if math.sqrt(i) - int(math.sqrt(i)) == 0:
        print(i)
        break

Submission status: Accepted

Solution code:
N=int(input())
list=[]
for a in range(1,round((10**9)**0.5)):
    b=a**2
    list.append(b)
newlist=[a for a in list if a<=N]
print(max(newlist))

Submission status: Accepted

Solution code:
# Author: cr4zjh0bp
# Created: Thu Mar 12 20:21:32 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

N = ni()

i = 1
ans = 0
while i * i <= N:
    ans = i * i
    i += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())
for x in range(N, 0, -1):
    sq = math.sqrt(x)
    div, mod = divmod(sq, 1)
    if mod == 0:
        print(x)
        break

Submission status: Accepted

Solution code:
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

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


resolve()

Submission status: Accepted

Solution code:
import sys
import os


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    X = int(sys.stdin.readline().rstrip())**0.5
    print(int(X)**2)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
k = []
ans = 0
for i in range(10**5):
  if N-i**2 < 0:
    print(ans)
    break
  else:
    ans = i**2

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#インクルード
import math

#定義

#ロジック箇所
N = int(input())
ruto = math.floor(math.sqrt(N))
ruto = ruto ** 2
print(ruto)

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
# from fractions import gcd
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def main():
    N = INT()
    print(int(sqrt(N)) ** 2)


if __name__ == '__main__':
        main()

Submission status: Accepted

Solution code:
import sys
import 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
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

for i in range(N, 0, -1):
    s = sqrt(i)
    if int(s) ** 2 == int(i):
        print(i)
        break

Submission status: Accepted

Solution code:
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
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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

for i in range(1, int(N**(1/2)+5)):
    if i**2 > N:
        print((i-1)**2)
        break

Submission status: Accepted

Solution code:
N = int(input())
for i in range(10**5):
  if N<i**2:
    print((i-1)**2)
    exit()

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

for n in range(N,0,-1):
    sq_n = math.sqrt(n)
    if sq_n == int(sq_n):
        break
        
print(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for n in range(n,0,-1):
    if (n ** 0.5).is_integer():
        print(n)
        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:
n = int(input())
m = 1
for i in range(1, n):
    if i ** 2 > n:
        break
    m = i ** 2
print(m)

Submission status: Accepted

Solution code:
#ABC077

n = int(input())
import math

print(int((math.sqrt(n)//1)**2//1))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

for i in range(n,-1,-1):
  if int(i**0.5)**2==i:
    print(i);exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
i =1
n = math.sqrt(n)
while True:
    if i <= n:
        i += 1
    else:
        print((i-1)**2)
        exit()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
#!/usr/bin/env pypy3
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    N=I()
    ans=1
    for i in range(10**5):
        a=i*i
        if a>N:
            ans=(i-1)*(i-1)
            break
    print(ans)

main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
from math import sqrt

def I(): return int(input())
def MI(): return map(int, input().split())
def LMI(): return list(map(int, input().split()))
MOD=10 ** 9 + 7


N = I()
rt = sqrt(N)
if rt.is_integer():
    print(N)
else:
    print(int(rt) ** 2)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN

N = int(input().strip())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())

Root_max = int(np.floor(N**0.5))

ans = Root_max**2

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
res = 0
for i in range(int(N**.5) + 1):
  res = max(res, i * i)
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
cnt = 0
ans = 0

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def aroundsquare(n):

    return (int(n**0.5)**2)

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())
for i in range(int(math.sqrt(N)) + 1, 0, -1):
    if int(math.pow(i, 2)) <= N:
        print(int(math.pow(i, 2)))
        break

Submission status: Accepted

Solution code:
def main():
    limit = int(input())
    square_num = 0
    i = 1
    while True:
        if i * i <= limit:
            square_num = i * i
            i += 1
        else:
            break
    print(square_num)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
for x in range(N+1)[::-1]:
    if int(x**0.5)**2==x:
        print(x)
        exit()

Submission status: Accepted

Solution code:
n = int(input())

bool = True
while bool:
    if n**(1/2)%1 == 0:
        bool = False
    else:
        n -= 1
        
print(n)

Submission status: Accepted

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

print((i-1)**2)

Submission status: Accepted

Solution code:
n = int(input())

for i in range(n):
    if i**2 > n:
        break

if n == 1 or n == 2:
    print(1)
else:
    print((i-1)**2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = [i**2 for i in range(1, 10**5+1)]
j = 0
for j in range(10**5):
    if n < l[j]:
        print(l[j-1])
        exit()

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n,0,-1):
  if (i**0.5).is_integer()==True:
    print(i)
    break

Submission status: Accepted

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

while (N > 0):
    if math.sqrt(N).is_integer():
        print(N)
        break
    N -= 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
ans = 0

for i in range(a+1):
    if i*i > a:
        break
    else:
        ans = i*i
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import math


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
a = int(input())
b = math.floor(a ** 0.5)

print(b ** 2)

Submission status: Accepted

Solution code:
N = int(input())
answer = 0
for i in range(1,int(N**.5)+1):
    if i**2 <= N:
        answer = max(answer,i**2)
print(answer)

Submission status: Accepted

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

while n > 0:
  if math.sqrt(n) % 1 == 0:
    print(n)
    exit()
  n -= 1

Submission status: Accepted

Solution code:
n = int(input())

for i in reversed(range(n+1)):
    if (i ** .5).is_integer():
        print(i)
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

for i in range(0,n):
	if n == 1 or n == 2:
		print(1)
		exit()
	if i * i > n:
		print((i-1) * (i-1))
		exit()

Submission status: Accepted

Solution code:
import math

n=int(input())

for i in range(n,0,-1):
    if math.sqrt(i).is_integer():
        print(i)
        break

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

i = 1

while (i+1)**2 <= n:
  i += 1

print(i**2)

Submission status: Accepted

Solution code:
N = int(input())

for i in range(1, int(N ** (1/2)) + 1):
  if i ** 2 > N:
    print((i - 1) ** 2)
    exit()
print(i ** 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in reversed(range(n+1)):
    if i**(0.5)%1 == 0:
        ans = i
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import math
import string

def intinput():
    return int(input())

def listintinput():
    return list(map(int,input().split()))

def splitintinput():
    return map(int,input().split())

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

Submission status: Accepted

Solution code:
from math import sqrt, floor
N = int(input())

print(floor(sqrt(N))**2)

Submission status: Accepted

Solution code:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    print(int(n**0.5)**2)
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

arr = []
i = 0
while(True):
    if i*i <= n:
        arr.append(i*i)
        i += 1
    else:
        break

print(arr[-1])

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 29, Jan, 2020
"""

import sys

# import itertools
# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(readline())
ans=int(N**.5)
print(ans*ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(n):
  pre = 1
  s = 1
  i = 1
  while s <= n:
    pre = s
    s = i * i
    i += 1
  return pre
print(f(int(input())))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
n = int(input())
print(int(n**(1/2))**2)

Submission status: Accepted

Solution code:
N = int(input())
answer = 0
n = 1
while True:
    if n**2 <= N:
        answer = n**2
        n += 1
    else:
        break

print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = math.floor(math.sqrt(N)) ** 2

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

for i in reversed(range(1, int(n**0.5)+1)):
    if i**2 <= n:
        print(i**2)
        break

Submission status: Accepted

Solution code:
N = int(input())
import math
x = math.floor(N**0.5)
print(x**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())
for i in range(n):
    a = i**2
    if a>n:
        b = i
        break
if n<=2:
    print(1)
else:
    print((b-1)**2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
print((math.floor(n**0.5)**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())
x = 1
while x * x <= n:
    x += 1

x -= 1
print(x * x)

Submission status: Accepted

Solution code:
n = int(input())

for i in range(99999):
    if i**2 > n:
        print((i-1)**2)
        exit()

Submission status: Accepted

Solution code:
import math

n = int(input())

sq = 0
for i in range(n,0,-1):
  sq = math.sqrt(i)
  if sq.is_integer():
    print(i)
    break

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


import numpy as np

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

Submission status: Accepted

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

for i in range(N, 0, -1):
    if sqrt(i).is_integer():
        break

print(i)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = int(input())
n = int(N ** (1/2))
print(n ** 2)