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: Runtime Error

Solution code:
using namespace std;

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <limits>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <numeric>
typedef long long ll;
typedef pair<int,int> p;

int main()
{
  long double n;
  cin >> n;
  while (true)
  {
    if (pow(n,0.5) == floor(pow(n,0.5)))
    {
      cout << n << endl;
      return 0;
    }
    n--;
  }

}

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
print(max([i*i for i in range(10001) if int(input())>=i]))

Submission status: Runtime Error

Solution code:
N=input(N)

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

Submission status: Runtime Error

Solution code:
N = input()

i = 1
sq = i * i
while sq <= N:
    i += 1
    temp = i * i
    if temp > N 
        break
    sq = temp

print(sq)

Submission status: Runtime Error

Solution code:
import numpy as np

n = input()

for i in range(n):
    a = int(np.sqrt(n - i))
    b = n - i
    if a**2 == b:
        print(b)
        break
    else:
        pass

Submission status: Runtime Error

Solution code:
import math

n = input()

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

Submission status: Runtime Error

Solution code:
import math

n = input()

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

Submission status: Runtime Error

Solution code:
n = input()

for i in range(n):
    a = sqrt(n - i)
    if type(a) is int:
        print(a)
    else:
        pass

Submission status: Runtime Error

Solution code:
import sys
import math

n = int(raw_input())

root = math.floor(math.sqrt(n))
print(int(root * root))

Submission status: Runtime Error

Solution code:
N = int(input().strip())

count = 0
while True:
    if (count + 1) ** 2 > N:
        print(coun ** 2t)
        break
    count += 1

Submission status: Runtime Error

Solution code:
def divisor_num(n):
    a = 1
    for _, x in factorization(n):
        a *= x + 1
    return a
  
N=int(input())
n=0
x=1
for i in range(N+1):
  n=divisor_num(i)
  if(i%2!=0):
   x=i
print(x)

Submission status: Runtime Error

Solution code:
import sys

DBG_FLAG = 0

def p_dbg(str):
    if(DBG_FLAG == 1):
        sys.stdout.flush()
        print str

# 1st. get Num

Num = int(raw_input())

p_dbg('Num : ' + str(Num))

square_max = 1

for i in range(1, Num):
    tmp = i * i
    p_dbg(str(i) + str(square_max))
    if(tmp <= Num):
        square_max = tmp
    else:
        break

print square_max

Submission status: Runtime Error

Solution code:
def bisearch(f, n):
    l = 0
    r = n
    fl = f(l)
    fr = f(r)
    while l <= r:
        m = (l + r) // 2
        fm = f(m)
        if fm == n:
            return m
        elif fm > n:
            r = m - 1
            fr = f(r)
        else:
            l = m + 1
            fl = f(l)

def try_square_root(n2):
    return bisearch(lambda n:n*n, n2)

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

Submission status: Runtime Error

Solution code:
count = 0
while True:
    if (count + 1) ** 2 > N:
        print(count)
        break
    count += 1

Submission status: Runtime Error

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

N = input()

for i in range(N):
    if i*i > N:
        print (i-1)*(i-1)
        break
else:
    pass

Submission status: Runtime Error

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

Submission status: Runtime Error

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