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:
def solve():
    N = int(input())
    for i in range(N, 0, -1):
        if (i ** 0.5).is_integer():
            print(i)
            exit()


if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
ans = 0
for i in range(31625):
    if i*i > N:
        break
    else:
        ans = i*i
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

for n in range(N):
    num = N - n
    sqrt_num = math.sqrt(num)
    
    if (int(sqrt_num) == sqrt_num):
        print(num)
        break

Submission status: Accepted

Solution code:
N = int(input())

import math
n_sqrt = math.floor(math.sqrt(N))
print(n_sqrt ** 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())


def ans():
    for i in range(100000):
        if i * i > N:
            return (i - 1) * (i -1)


print(ans())

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt, floor
print(floor(sqrt(int(input())))**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(n + 1):
    if (i + 1) ** 2 > n:
        break
print(i ** 2)

Submission status: Accepted

Solution code:
import bisect
n = int(input())
li = []
for i in range(100000):
    li.append(i**2)
a = bisect.bisect_right(li, n)
print(li[a-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
c=[]
for i in range(n+1):
  a = i**2
  if a <= n:
    c.append(a)
  else:
    break
print(max(c))

Submission status: Accepted

Solution code:
s = input()

n = int(s)

answer = []

x = 1
answer.append(x)

while (x * x <= n):
    x += 1
    answer.append(x * x)

p = answer.pop()
if p == 1:
    print(p)
else:
    ans = answer.pop()
    print(ans)

Submission status: Accepted

Solution code:
n=int(input())
for i in range(n):
    if (n-i)**(0.5)==int((n-i)**0.5):
        print((n-i))
        break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

print(int(N**(0.5))**2)

Submission status: Accepted

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

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:
import math
print(math.floor(math.sqrt(int(input())))**2)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
INF = 10**9

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict, deque

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


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

    N = ii()

    ret = 0
    for n in range(int(N ** 0.5) + 1):
        if n * n <= N:
            ret = max(ret, n * n)
    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def actual(N):
    for i in range(N, 0, -1):
        is_square_number = (i ** 0.5) % 1 == 0

        if is_square_number:
            return i

N = int(input())
print(actual(N))

Submission status: Accepted

Solution code:
def actual(N):
    for i in range(1, 10 ** 9 + 1):
        if i ** 2 > N:
            return (i - 1) ** 2

N = int(input())
print(actual(N))

Submission status: Accepted

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

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:
print(int((pow(int(input()), 1/2)//1)**2))

Submission status: Accepted

Solution code:

N = int(input())
sq = (int(N**(1/2))**2)
print(sq)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
while True:
  sq = n**0.5
  if sq.is_integer():
    break
  else:
    n-=1
print(n)

Submission status: Accepted

Solution code:
n = int(input())

i = 1
while True:
    t = i*i
    if t == n:
        print(t)
        exit()
    elif t > n:
        print((i-1)*(i-1))
        exit()
    
    i += 1

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:
N = int(input())

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

N = int(input())

ans = 1
i = 1

while True:
    ans = i ** 2
    i += 1
    if i ** 2 > N:
        break

print(ans)

Submission status: Accepted

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

print((i-1)**2)

Submission status: Accepted

Solution code:
from math import sqrt
n=int(input())
while True:
    if sqrt(n)%1==0:
        print(n)
        break
    n-=1

Submission status: Accepted

Solution code:
import math

n = int(input())

while True:
  x = math.sqrt(n)
  #####print(n)
  if x.is_integer():
    print(n)
    exit()
  n -= 1

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()

n = 1
while 1:
  if n**2 > N:
    print((n-1)**2)
    exit()
  else:
    n += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if not ( 1 <= N <= 10 ** 9 ):
    sys.exit

root_N = math.floor(math.sqrt(N))
print(root_N ** 2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def main():
  n = int(input())
  for i in reversed(range(1,n+1)):
    if math.sqrt(i) %1==0:
      print(i)
      break;
main()

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:
import math
N=int(input())
print(int(math.sqrt(N))**2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
N_square_root = math.floor(math.sqrt(N))
result = 0
for i in range(N_square_root + 1):
    result = i * i
print(result)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def mi():
    return map(int, input().split())

def ii():
    return int(input())

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
square = [i ** 2 for i in range(1, int(n**0.5)+1)]
print(max(square))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 1
for i in range(10**5):
    if i**2 <= N:
        ans = i**2
    if i**2 > N:
        break

print(ans)

Submission status: Accepted

Solution code:
a = int(input())

for i in range(1, int(a ** .5)+2):
  if i ** 2 > a:
    print((i-1)**2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
if N == 1:
  print(1)
  quit()

pre = 0
for i in range(1, N+1):
  n = i**2
  if n > N:
    print(pre)
    quit()
  
  pre = n

Submission status: Accepted

Solution code:
N = int(input())
answer = 0
for x in range(1, 100000):
  if x ** 2 <= N:
    answer = x ** 2
  else:
    break
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
i = 1
while True:
  if i**2 > n:
    ans = (i-1)**2
    break
  i += 1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    ans = int(N ** 0.5) ** 2

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from math import sqrt
N=int(input())
x=int(sqrt(N))
if (x+1)**2<=N:
    print((x+1)**2)
else:
    print(x**2)

Submission status: Accepted

Solution code:
if __name__ == '__main__':
    n =int(input())
    max = 1
    for i in range(1,n):
        now = i*i
        if now > n:
            break
        max = now
    print(max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
for i in range(int(input()), 0, -1):
	if np.sqrt(i) == int(np.sqrt(i)):
		print(i)
		exit()

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

for i in reversed(range(N)):
    n = math.sqrt(N)
    if n.is_integer():
        print(int(n ** 2))
        exit()
    N -= 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
for i in reversed(range(1,N+1)):
  if (i**.5).is_integer():
    print(i)
    exit()

Submission status: Accepted

Solution code:
import math
n=int(input())
x=0
for i in range(n):
    if math.sqrt(n-i)%1==0.0:
        break
    else:
        x+=1
print(n-x)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for n in range(N+1):
    if n*n <= N: ans = n*n
    else: break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
import math

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

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)):
        print(i)
        break

Submission status: Accepted

Solution code:
from decimal import Decimal
n=int(input())
print(int(Decimal(n).sqrt())**2)

Submission status: Accepted

Solution code:
n=int(input())
i=1
while True:
  if i**2>n:
    ans=(i-1)**2
    break
  i+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import ceil, sqrt

N = int(input())
M = ceil(sqrt(N))
if M ** 2 <= N:
    print(M ** 2)
else:
    print((M - 1) ** 2)

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=n
for i in range(n):
    num=math.sqrt(ans)
    if num%1==0:
        break
    ans-=1
print(ans)

Submission status: Accepted

Solution code:
n= int(input())

m = int(n**(0.5))

print(m*m)

Submission status: Accepted

Solution code:
N=int(input())
i = 0
while N>=i*i :
    i+=1
print((i-1)*(i-1))

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

i=0
while (n-i)**0.5 % 1 != 0:
    i+=1
print(n-i)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
print(int(n**.5)**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
while ans**2 <= n:
    if ans**2 <= n: ans += 1
print((ans-1)**2)

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:
import math
N = int(input())

while True:
    if math.sqrt(N) % 1 == 0:
        print(N)
        exit()
    N -= 1

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
for i in range(n, 0, -1):
    if np.sqrt(i) % 1 == 0:
        print(i)
        break

Submission status: Accepted

Solution code:
N = int(input())

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

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())
count = 0

for i in range(1,10**10):
  if i**2 <= n:
    count = i**2
  else:
    print(count)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

import sys
# import time
import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    candidate = int(math.sqrt(n))
    print(candidate**2)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())
ans = int(n** 0.5)**2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
X = math.floor(N**.5)
print(X**2)

Submission status: Accepted

Solution code:
n = int(input())

ans = 0

for a in range(10**5 + 1):
    if a**2 <= n:
        ans = max(ans, a**2)

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())

ans = 0

for a in range(10**5 + 1):
    if a**2 <= n:
        ans = max(ans, a**2)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

if math.sqrt(n).is_integer():
    print(n)
else:
    tmp = math.floor(math.sqrt(n))
    print(tmp*tmp)

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:
# -*- coding: <encoding name> -*-

n = int(input())
m = int(n ** (1 / 2)) ** 2
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
while True:
    if math.sqrt(n) % 1 == 0:
        print(n)
        break
    n -= 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 1
while ans**2 <= N:
  ans += 1

print((ans-1)**2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math

input = sys.stdin.readline

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import bisect

def solve(n):
    return math.floor(math.sqrt(n)) ** 2

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

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
A = [int(x) for x in range(1,34000)]
for i in range(33999):
    A[i] = A[i]**2

B = [i for i in A if i <= n]

print(max(B))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 0
for i in range(int(pow(N,1/2))+1):
    if i**2 <=N:
        ans = i**2
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
## io ##
def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))
## dp ##
def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]
## math ##
def to_bin(x: int) -> str: return format(x, 'b') # rev => int(res, 2)
def to_oct(x: int) -> str: return format(x, 'o') # rev => int(res, 8)
def to_hex(x: int) -> str: return format(x, 'x') # rev => int(res, 16)
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i): is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]
def prime_factor(n):
    """Return a list of prime factorization numbers of n"""
    res = []
    for i in range(2,int(n**0.5)+1):
        while n%i==0: res.append(i); n //= i
    if n != 1: res.append(n)
    return res
## libs ##
from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left
#======================================================#

def main():
    n = II()
    print(int(n**(1/2))**2)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(N, 0, -1):
  if (i ** (1/2)) % 1 == 0:
    print(i)
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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