Problem:
 Score : 300 points    Problem Statement You are given an integer N . For two positive integers A and B , we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A , and the number of digits in the decimal notation of B . For example, F(3,11) = 2 since 3 has one digit and 11 has two digits. Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B .      Constraints  1 \leq N \leq 10^{10}  N is an integer.         Input The input is given from Standard Input in the following format:  N       Output Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B .        Sample Input 1 10000      Sample Output 1 3  F(A,B) has a minimum value of 3 at (A,B)=(100,100) .       Sample Input 2 1000003      Sample Output 2 7  There are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1) . For these pairs, F(1,1000003)=F(1000003,1)=7 .       Sample Input 3 9876543210      Sample Output 3 6

Solution (Python):
import sys

use_clipboard=True
bbn=1000000007
	


def gf(v):
	if v == 0:
		return 0
	return len(str(v))
		
def main():
	a = int(input())
	ret=0
	for i in range(1, int((a**0.5)+1)):
		if a % i == 0:
			ret = gf(a//i)

	print(ret)
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
class input_clipboard:
	def __init__(self,s):
		self.input_l=s.splitlines()
		self.ii=0
		
	def input(self):
		ret = self.input_l[self.ii]
		self.ii+=1
		return ret

if __name__ == "__main__":
	if sys.platform =='ios':
		if use_clipboard:
			import clipboard
			input_text=clipboard.get()
			ic=input_clipboard(input_text)
			input = lambda : ic.input()
		else:
			sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):

def divisor(N):
    
    divs = []
    for i in range(1, int(N**0.5)+1):
        if N % i == 0:
            divs.append(i)
            divs.append(N//i)
    return divs
def F(a, b):
    return max(len(str(a)), len(str(b)))
N = int(input())
divs = divisor(N)
ans = 10**9
for i in range(len(divs)//2):
    a, b = divs[2*i], divs[2*i+1]
    ans = min(ans, F(a,b))
print(ans)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
    

N=int(input())
d=make_divisors(N)

L=len(d)

if L%2==1:
    index=L//2+1
    m=d[index-1]
    sm=str(m)
    print(len(sm))
else:
    index1=L//2
    index2=L//2+1
    m1=d[index1-1]
    m2=d[index2-1]
    sm1=str(m1)
    sm2=str(m2)
    print(max(len(sm1),len(sm2)))

Solution (Python):

import math
N=int(input())
n=int(math.sqrt(N))
for i in range(n,0,-1):
    if N%i==0:
        ans=max(len(str(i)),len(str(N//i)))
        break
print(ans)

Solution (Python):
def d(n):
  return len(str(n))

N=int(input())
if N==1:
  print(1)
else:
  i=0
  
  while N%(int(N**0.5)-i)!=0:
    i=i+1
  print(max(d(int(N**0.5)-i),d(N//(int(N**0.5)-i))))

Solution (Python):
import math
N = int(input())
res = []
M = int(math.sqrt(N))

for i in range(1, M + 1):
    if N % i == 0:
        A = int(i)
        B = int(N / i)

        res.append(max([len(str(A)), len(str(B))]))

print(min(res))

Solution (Python):
import math

N = int(input())

a = math.ceil(N ** (1/2))

for i in range(a):
  if int(N % (a-i)) == 0:
    aa = len(list(str(int(a-i))))
    bb = len(list(str(int(N // (a-i)))))
    break

print(max(aa,bb))

Solution (Python):
def main():
    n = int(input())
    x,y = 0,0
    for i in range(1,int(n ** 0.5) + 1):
        if n % i == 0:
            x = i
            y = n // i
    print(max(len(str(x)),len(str(y))))

if __name__ == '__main__':
    main()

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
div = make_divisors(N)
ans = 10 ** 10
import bisect
idx = bisect.bisect(div, N ** (1 / 2))
loop = [idx-1, idx, idx+1]
can = []
for i in loop:
    if 0 <= i < len(div):
        can.append((div[i], N // div[i]))
for j in can:
    left, right = j
    ans = min(ans, max(len(str(left)), len(str(right))))
print(ans)

Solution (Python):
N = int(input())

ans = 100000000
i = 1
table = []
while i * i <= N:
  if N%i == 0:
    x = max([len(str(i)), len(str(N//i))])
    if x < ans:
      ans = x
  i += 1
  
print(x)

Solution (Python):

 
import math
import itertools
import sys
import copy
 




N = int(input())


i = 1
minNum = sys.maxsize
while i <= N**0.5 :
  if N % i == 0 :
    minNum = min(minNum, max(len(str(i)), len(str(N//i))))
  i += 1
print (minNum)

Solution (Python):
n = int(input())
tmp = n
for x in range(1, n+1):
    y = n//x
    if x > y:
        break
    if n % x == 0:
        tmp = y
ans = len(str(tmp))
print(ans)

Solution (Python):
n = int(input())

def F(A, B):
    if len(str(A)) > len(str(B)):
        return len(str(A))
    else:
        return len(str(B))
ans = float('inf')

for a in range(1,int(n**.5)+1):
    if n%a==0:
        b = n // a
        tmp = F(a, b)
        if ans > tmp:
            ans = tmp
print(ans)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def factor(n):
    rt_n = int(math.sqrt(n)) + 2
    for i in range(1, rt_n):
        if n % i == 0:
            yield (i, n//i)

def main():
    N = I()
    ans = inf
    for s1, s2 in factor(N):
        f = max(len(str(s1)), len(str(s2)))
        ans = min(ans, f)
    print(ans)



main()

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            if i != n // i:
                divisors.append([i, n//i])
            else:
                divisors.append([i, i])
    return divisors


n = int(input())
d = make_divisors(n)[-1]
print(len(str(max(d[0], d[1]))))

Solution (Python):
n = int(input())

m = n ** 0.5

if (m.is_integer()):
   print(len(str(int(m))))
else:
   m = int(m)
   for i in reversed(range(1, m)):
      if (n % i == 0):
         print(len(str(int(n/i))))
         exit()

Solution (Python):
N = int(input())


def F(A, B):
    A = str(A)
    B = str(B)
    if len(A) >= len(B):
        return len(A)
    else:
        return len(B)

minimumList = []
for a in range(1, int(N**0.5) + 1):
    if N % a == 0:
        b = N // a  
        minimumList.append(F(a, b))
print(min(minimumList))

Solution (Python):
N = int(input())


def F(A, B):
    A = str(A)
    B = str(B)
    if len(A) >= len(B):
        return len(A)
    else:
        return len(B)

minimumList = []
for a in range(1, int(N**0.5) + 1):
    if N % a == 0:
        b = N // a
        minimumList.append(F(a, b))
print(min(minimumList))

Solution (Python):
N = int(input())
A = [[1, N]]
p = 2
dig = 10
while p <= int(N**(1/2)):
  if N % p == 0:
    A.append([p, N//p])
  p += 1
B = max(A)
print(len(str(max(B))))

Solution (Python):
n  = int(input())

count = float("inf")
for i in range(1, int(n ** 0.5 + 1)):
    if n // i == n / i:
        temp = max(len(str(i)), len(str(n//i)))
        count = min(count, temp)
        
print(count)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors

N = int(input())
list =  make_divisors(N)
ans = 10**9
if len(list)%2==1:
    list.append(list[-1])
for i in range(0,len(list),2):
    tmp1 = len(str(list[i]))
    tmp2 = len(str(list[i+1]))
    ans = min(ans,max(tmp1,tmp2))
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
def divisor(n):
    divisors=[]
    for i in range(1,int(n**0.5+1)):
        if n%i==0:
            divisors.append(i)
            if i!=n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

n=int(input())

s=divisor(n)
from bisect import bisect_left as bl
a=bl(s,n**0.5)
print(len(str(s[a])))

Solution (Python):

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)

    return divisors

def f(a,b):
    return max(len(str(a)), len(str(b)))

n = int(input())
divisors = make_divisors(n)
ans = float('INF')

for i in divisors:
    tmp = f(i, n//i)
    if tmp < ans:
        ans = tmp
print(ans)

Solution (Python):
import math
N = int(input())
ans = 100000
for k in range(2,math.floor(math.sqrt(N))+1):
    if N % k == 0:
        ans = min(ans,max(len(str(k)),len(str(N//k))))
if ans == 100000:
    print(len(str(N)))
else:
    print(ans)

Solution (Python):
n=int(input())
ans=inf=float('inf')
for i in range(1,int(n**0.5)+1):
  if n%i:continue
  ans=max(len(str(n%i)),len(str(n//i)))
print(ans)

Solution (Python):
N = int(input())

def make_divisors(n):
    import math
    divisors = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0: 
            divisors.append(i)
            if i != n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

def F(A, B):
    return max(len(str(A)), len(str(B)))


lst = make_divisors(N)

ans = 10 ** 18
for a in lst:
    b = N // a
    ans = min(ans, F(a, b))

print (ans)

Solution (Python):
n = int(input())

ans = float("inf")
for a in range(1, int(n ** 0.5) + 1):
    if n % a == 0:
        b = n // a
        ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)

Solution (Python):
N = int(input())

ans = 11
for i in range(1, int(N**0.5)+1):
    A = str(i)
    if N % i != 0:
        continue
    B = str(N//i)
    ans = min(ans, max(len(A), len(B)))

print(ans)

Solution (Python):
n = int(input())

f = []
for a in range(1, int(n ** 0.5) + 1):
    if n % a == 0:
        f.append(len(str(max(a, n // a))))
else:
    print(min(f))

Solution (Python):
import math

N=int(input())
li = []

for a in range(math.floor(math.sqrt(N)) + 1):
  if a == 0:
    continue
  
  if N % a == 0:
    b = math.floor(N / a)
    li.append([a, b])

ans = 100000000000000000000000000

for i in li:
  if len(str(i[0])) >= len(str(i[1])):
    k = len(str(i[0]))
  else:
    k = len(str(i[1]))

  if ans > k:
    ans = k

print(ans)

Solution (Python):
n = int(input())

mx = int(n ** 0.5)
ans = 10

for i in range(1, mx + 1):
    if n % i == 0:
        la = len(str(i))
        lb = len(str(n // i))
        if max(la, lb) < ans:
            ans = max(la, lb)

print(ans)

Solution (Python):
N = int(input())

import math
N_sqrt = int(math.sqrt(N))

A = [i for i in range(1, N_sqrt+1) if N%i == 0]

print(len(str(N // A[-1])))

Solution (Python):
import math
n=int(input())
nn=math.ceil(math.sqrt(n))

ans=10**10
for i in range(1,nn+1):
    if n % i == 0:
        j = n // i
        s=max(i,j)
        ans=min(len(str(s)),ans)
print(ans)

Solution (Python):
from sys import exit
import math
n=int(input())
l=math.floor(math.sqrt(n))

for i in range(l+1,0,-1):
    if n%i==0:
        a,b=i,n//i
        h=max(a,b)
        k=math.floor(math.log10(h))+1
        print(k)
        exit()

Solution (Python):
import math
n=int(input())
l=math.floor(math.sqrt(n))

for i in range(l+1,0,-1):
    if n%i==0:
        a,b=i,n//i
        k=max(math.floor(math.log10(a))+1,math.floor(math.log10(b))+1)
        break
print(k)

Solution (Python):
import math
n=int(input())
l=math.floor(math.sqrt(n))
k=math.floor(math.log10(n))+1


for i in range(2,l+1):
    if n%i==0:
        a,b=i,n//i
        x=max(math.floor(math.log10(a))+1,math.floor(math.log10(b))+1)
        k=min(x,k)
print(k)

Solution (Python):
n = int(input())

def Check(x):
    cont= 0
    while x > 0:
        x = x//10
        cont += 1
    return cont

a = []
for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        a.append(i)

a = max(a)
b = n//a

print(max(Check(a), Check(b)))

Solution (Python):
n=int(input())
ans=len(str(n))
from math import floor,sqrt
s=floor(sqrt(n))
f=[]
ans=len(str(n))
for i in range(2,s+1):
    if n%i==0:
        t=max(len(str(i)),len(str(n//i)))
        if t<ans:
            ans=t
print(ans)

Solution (Python):
N = int(input())

divisor_list = []
for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        divisor_list.append(i)
        
A = max(divisor_list)
B = N // A

print(max(len(str(A)), len(str(B))))

Solution (Python):
N = int(input())
ans = len(str(N))
for _ in range(1,int(N**(0.5)+1)):
  if N%_ ==0:
    ans = min(ans,max(len(str(_)),len(str(N//_))))
print(ans)

Solution (Python):
n = int(input())
ans = float("inf")

for i in range(1,int(n**0.5//1)+1):
    if n%i==0:
        ans = min(ans,max(map(lambda x:len(str(x)),(i,n//i))))

print(ans)

Solution (Python):
import math
import sys
N = int(input())

min = sys.maxsize
for i in range(1,int(math.sqrt(N))+1):
    if N%i==0:
        A = str(i)
        B = str(N//i)
        
        ans = max(len(A),len(B))

        if ans < min:
            min = ans

print(min)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
answer = 0
len_div = len(make_divisors(N))

if len_div % 2 == 0:
    A_len = len(str(make_divisors(N)[len_div // 2 - 1]))
    B_len = len(str(make_divisors(N)[len_div // 2]))
    if A_len <= B_len:
        answer = B_len
    else:
        answer = A_len
else:
    answer = len(str(make_divisors(N)[len_div // 2]))
print(answer)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

N = int(input())
answer = 0
len_div = len(make_divisors(N))






if len_div % 2 == 0:
    A_len = len(str(make_divisors(N)[len_div // 2 - 1]))
    B_len = len(str(make_divisors(N)[len_div // 2]))
    if A_len <= B_len:
        answer = B_len
    else:
        answer = A_len
else:
    answer = len(str(make_divisors(N)[len_div // 2]))
    
print(answer)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)

    return divisors

def f(a,b):
    return max(len(str(a)), len(str(b)))

n = int(input())
divisors = make_divisors(n)
ans = float('INF')
for i in divisors:
    tmp = f(i, n//i)
    if tmp < ans:
        ans = tmp
print(ans)

Solution (Python):
N = int(input())
import math
ans = 10**18
for n in range(1,int(math.sqrt(N)+10)):
    if N%n == 0:
        value = max(len(str(n)),len(str(N//n)))
        if value < ans:
            ans = value
print(ans)

Solution (Python):
import math
import sys


def solve(inp):
    N = int(inp.readline())

    r = len(str(N))
    for i in range(2, int(math.sqrt(N)) + 1):
        if N % i == 0:
            m = max(len(str(i)), len(str(int(N / i))))
            r = min(r, m)

    return str(r)


def main():
    result = solve(sys.stdin)
    if result:
        print(result)


if __name__ == '__main__':
    main()

Solution (Python):
import math

ans = 10**9
n = int(input())
for i in range(1,math.ceil(math.sqrt(n))+1):
  if n%i == 0:
    m = max(len(str(i)), len(str(n//i)))
    ans = min(ans,m)
    
print(ans)

Solution (Python):
N = int( input() )

def make_divisors( n ) :
   res = []
   for i in range(1, int(n**0.5)+1) :
       if n%i == 0 :
          res.append(i)
          res.append(int(n/i))
   return res

divs = make_divisors( N )


print( len( str( max( divs[len(divs)-1],divs[len(divs)-2] ) ) ) )

Solution (Python):


import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

def divisors(N: int) -> set:
    """ 約数の列挙・個数 """
    from math import sqrt

    
    s = {1, N}
    
    for i in range(2, int(sqrt(N))+1):
        
        if N % i == 0:
            s.add(i)
            s.add(N // i)
    return s

def compare(a, b):
    return max(len(str(a)), len(str(b)))

N = INT()

ans = INF
for div1 in divisors(N):
    div2 = N // div1
    ans = min(ans, compare(div1, div2))
print(ans)

Solution (Python):
N = int(input())
A = int(N**0.5)
for i in reversed(range(A+1)):
	if(N%i==0):
		print(len(str(N//i)))
		exit()

Solution (Python):
N = int(input())
ans = 11
for i in range(1,int(N**(0.5))+1):
    if N%i == 0:
        ans = min(ans,max(len(str(i)),len(str(N//i))))
print(ans)

Solution (Python):
N = int(input())

n = int((N ** 0.5) // 1)

ans = 11
for i in range(1,n+1):
    if N % i == 0:
        a = i
        b = N // i
        f = max(len(str(a)), len(str(b)))
        ans = min(ans, f)
    
print(ans)

Solution (Python):
N = int(input())

min = float("inf")
for A in range(1,int((N**0.5))+1,1):
    if N%A!=0:
        continue
    B = N//A
    keta_A = len(str(A))
    keta_B = len(str(B))
    if keta_A >= keta_B:
        if keta_A<min:
            min = keta_A
        continue
    else:
        if keta_B<min:
            min = keta_B
print(min)

Solution (Python):
n=int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

ans = 10**1000
for i in make_divisors(n):
    ans = min(ans, max(len(str(n//i)), len(str(i))))
print(ans)

Solution (Python):
n=int(input())
for i in range(int(n**0.5)):
  if n%(i+1)==0:
    ans=n//(i+1)
print(len(str(ans)))

Solution (Python):
from operator import itemgetter
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    sq = int(N**(1/2))
    
    def keta(x):
        k = 0
        while x > 0:
            x //= 10
            k += 1
        return k
        
    for i in range(sq)[::-1]:
        i += 1
        if N%i == 0:
            print(keta(N//i))
            exit()
    
if __name__ == "__main__":
    main()

Solution (Python):
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def keta(n):
    return len(str(n))

def main():
    n = int(input().strip())
    i = 1
    ans = INF
    while i**2 <= n:
        if n % i == 0:
            ans = min(ans, max(keta(i), keta(n//i)))
        i += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
i=int(pow(N, 1/2))
while N%i>0:
  i-=1
print(len(str(N//i)))

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors

N = int(input())
print(len(str(make_divisors(N)[-1])))

Solution (Python):
N = int(input())

ans = 1<<60
for a in range(1, int(N**0.5)+1):
  if N%a==0:
    b = N//a
    max_len = max(len(str(a)), len(str(b)))
    ans = min(ans, max_len)
print(ans)

Solution (Python):

import numpy as np

N = int(input())
max_A = int(np.sqrt(N))

while max_A > 0:
    if N %  max_A == 0:
        B = N / max_A
        break
    else:
        max_A -= 1

digit_count = 0
while B >= 1:
    digit_count += 1    
    B /= 10

print(digit_count)

Solution (Python):
import math
from fractions import gcd
import collections


N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    
    return divisors

yaku = sorted(make_divisors(N))
num = math.floor(math.sqrt(N))

for a in yaku:
    if (a >= num):
        print(len(str(a)))
        exit()

Solution (Python):
N = int(input())
ans = float('inf')
def f(A,B):
  return max(len(str(A)),len(str(B)))
for i in range(1,int(N**0.5)+1):
  if N%i==0:
    ans = min(ans,f(i,int(N/i)))
print(ans)

Solution (Python):
N = int(input())
ans = 10**20
for i in range(1,int(N**0.5)+1):
    if N%i==0: ans = min(ans, len(str(N//i)))
print(ans)

Solution (Python):
N = int(input())

def factorize(n):
  i = 1
  j = 0 
  nums = []
  while i * i <= n:
    if n % i == 0:
      j = int(n / i)
      j = str(j)
      nums.append([i,j])
    i += 1
  return nums
  
factors = factorize(N)
print(len(factors[-1][1]))

Solution (Python):
n = int(input())

sqrt = int((n ** (1/2)) // 1)
ans = 20
for i in range(1, sqrt+1):
    if n % i == 0:
        a = i
        b = int(n / i)
        if len(str(b)) < ans:
            ans = len(str(b))

print(ans)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

def digit_count(n):
  str_n = str(n)
  
  return len(str_n)

N = int(input())
divisor = make_divisors(N)

if len(divisor) % 2 == 1:
  num = divisor[int(len(divisor)/2)]
  ans = digit_count(num)
  print(ans)
else:
  num1 = divisor[int(len(divisor)/2) -1]
  num2 = divisor[int(len(divisor)/2)]  
  ans1 = digit_count(num1)
  ans2 = digit_count(num2)
  
  if ans1 > ans2:
    print(ans1)
  elif ans2 > ans1:
    print(ans2)
  else:
    print(ans1)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

N = int(input())
lis = sorted(make_divisors(N))

ans = 10000
for i in range(len(lis)):
    a, b = lis[i], N // lis[i]
    f = max(len(str(a)), len(str(b)))
    ans = min(ans, f)
print(ans)

Solution (Python):
import math
N = int(input())
T = 100
for i in range(1,(math.ceil(N**0.5))+1):
    if N%i ==0:
        A = int(i)
        B = int(N/i)
        Q = len(str(max(A, B)))
        T = min(T,Q)
print(T)

Solution (Python):
n = int(input())

def make_divisors(n):
   divisors = []
   for i in range(1, int(n**0.5)+1):
       if n % i == 0:
           divisors.append(i)
           if i != n // i:
               divisors.append(n//i)
   
   return divisors

divisors = make_divisors(n)

ans = float("inf")
for d in divisors:
    p = n // d
    ans = min(ans, max(len(str(d)),len(str(p))))

print(ans)

Solution (Python):


ans=10**6
n=int(input())
for i in range(1,int(n**0.5)+1):
  if n%i==0:
    ans=min(len(str(n//i)),ans)
    
print(ans)

Solution (Python):





N = int(input())
result = len(str(N))

for i in range(1,int(pow(N,0.5)+1)):
    if(N % i == 0):
        s = max(len(str(i)), len(str(int(N/i))))
        result = min(s,result)
print(result)

Solution (Python):
from math import sqrt

N = int(input())

for A in range(int(sqrt(N)),-1,-1):
    if N % A == 0:
        print(len(str(N//A)))
        exit()

Solution (Python):


import math
N=int(input())
n=int(math.sqrt(N))
dev=0
for i in range(1,n+1):
    if N%i==0:
        dev=i
print(max(len(str(dev)),len(str(N//dev))))

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf')
ans = 0 ;count = 0 ;pro = 1

n=int(input())

def f(a,b):
    return max(len(str(a)),len(str(b)))

ans=inf
for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
        ans=min(ans,f(i,n//i))

print(ans)

Solution (Python):
n = int(input())
ans = float('inf')


def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)

    
    return divisors


candidate = make_divisors(n)
for i in range(len(candidate)):
    a = str(candidate[i])
    b = str(n // candidate[i])
    ans = min(ans, max(len(a), len(b)))
print(ans)

Solution (Python):
import sys

n = int(sys.stdin.readline().rstrip())

def main():
    a = 1
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            a = i
    b = n // a
    ans = len(str(b))
    return ans

if __name__ == '__main__':
    ans = main()
    print(ans)

Solution (Python):
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append([str(i),str(n//i)])
 
    return divisors


def f(a,b):
    return max(len(a),len(b))

n = int(input())

divisors = make_divisors(n)

ans = 20
for i in divisors:
    ans = min(ans,f(i[0],i[1]))
    
print(ans)

Solution (Python):
n = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

l = make_divisors(n)


A = l[len(l)//2]
B = l[len(l)//2-1]

print( max( len(str(A)), len(str(B)) ) )

Solution (Python):

N = int(input())

ans = 11
a = 1
i = 1
while i * i <= N:
    if N % i == 0:
        a = i
        b = N//a
        ans = min(ans, len(str((max(a,b)))))
    i += 1

print(ans)

Solution (Python):
import math
n=int(input())
sq=math.sqrt(n)
sq=int(sq)//1
up=0
for i in range(1,sq+1):
  if not n%i:
    up=i
ans=max(up,n//up)
print(len(str(ans)))

Solution (Python):
N = int(input())
ans = 10000000000
for i in range(1, int(N**0.5) + 1): 
        if N % i != 0:
                continue
        ans = min(ans, max(len(str(i)), len(str(N // i))))
print(ans)

Solution (Python):
n=int(input())
ans = []
for i in range(1,int(n**0.5+1)):
  if n%i==0:
    j=n//i
    ans.append(max(len(str(i)),len(str(j))))
print(min(ans))

Solution (Python):

n = int(input())

r = []
for A in range(1, int(n**(1/2)) +1):
    B = n / A
    if B.is_integer():
        r.append(max([len(str(A)),len(str(int(B)))]))
print(min(r))

Solution (Python):
import math
n = int(input())
x = 0
for i in range(1,int(math.sqrt(n))+1):
  if n % i == 0:
    x = i
b = n // x
print(len(list(str(b))))

Solution (Python):
import math
n = int(input())
x = 0
for i in range(1,int(math.sqrt(n))+1):
  if n % i == 0:
    x = i
b = n // x
print(len(list(str(b))))

Solution (Python):
import math

N = int(input())

def F(A, B):
  return max(len(str(A)), len(str(B)))

ans = 10**10
for i in range(1, math.ceil(math.sqrt(N+1))+1):
  if N % i == 0:
    ans = min(ans, F(i, N//i))

print(ans)

Solution (Python):
import itertools


def trial_division(n):
    if n < 2:
        return []

    prime_factors = []

    for i in range(2, int(n**0.5)+1):
        
        while n % i == 0:
            
            prime_factors.append(i)
            
            n //= i
    
    if n > 1:
        prime_factors.append(n)

    return prime_factors

n = int(input())
pf = trial_division(n)
numSet = set()
ans = 10**9



for i in range(1, len(pf)+1):
    combs = list(itertools.combinations(pf, i))
    

    for comb in combs:
        
        temp = 1
        for num in comb:
            temp *= num
        numSet.add(temp)

numSet.add(1)


for num in numSet:
    q1 = num
    q2 = n // q1
    length = max(len(str(q1)), len(str(q2)))
    ans = min(ans, length)

print(ans)

Solution (Python):
def divisor(N):
    div = []
    for i in range(1, int(N ** 0.5 + 1)):
        if N % i == 0:
            div.append(i)
            if i * i != N:
                div.append(N // i)
    return sorted(div)


N = int(input())
ans = 11
for div in divisor(N):
    ans = min(ans, max(len(str(div)), len(str(N // div))))

print(ans)

Solution (Python):
import math
n = int(input())
root_n = math.ceil(math.sqrt(n))
f = []
for i in range(1,root_n+1):
  if n % i == 0:
    f_pair = max(len(str(int(i))),len(str(int(n/i))))
    f.append(f_pair)
mini = min(f)
print(mini)

Solution (Python):
import math
N = int(input())
rootN = int(math.sqrt(N))
while N%rootN != 0:
    rootN -= 1
print(len(str(N//rootN)))

Solution (Python):
import math
N = int(input())
rN = int(math.sqrt(N))
for i in range(rN+1, 0, -1):
    if N % i == 0:
        a = max(i, N//i)
        break
print(len(str(a)))

Solution (Python):


def findBiggerDigits(n):
    digits = 0
    while n > 0:
        digits += 1
        n //= 10
    return digits 

def main()->None:
    n = int(input())
    sqrt_n = int(n ** (1/2))
    range_a = range(1, sqrt_n+1)

    min_value = 1000000
    for a in range_a:
        if n % a != 0: continue
        b = n / a
        a_digits = findBiggerDigits(a)
        b_digits = findBiggerDigits(b)
        max_dig = max(a_digits, b_digits)
        if max_dig < min_value:
            min_value = max_dig

    print(min_value)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
ans = 11
i = 1
while i ** 2 <= N:
  if N % i == 0:
    ans = min(ans, len(str(N // i)))
  i += 1
print(ans)

Solution (Python):
N = int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            
            divisors.append(n//i)

    divisors.sort()
    return divisors
div_lst = make_divisors(N)
len_div = len(div_lst)
ans = float("inf")
for i in range(len_div):
    tmp_ans = max(len(str(div_lst[i])) , len(str(div_lst[len_div - i - 1])))
    if ans > tmp_ans:

        ans = tmp_ans
print(ans)

Solution (Python):
import math
n = int(input())
nn = int(math.sqrt(n)) + 1
ans = max(1, len(str(n)))

for i in range(1, nn):
    if n % i == 0:
        if max(len(str(i)), len(str(n//i))) < ans:
            ans = max(len(str(i)), len(str(n//i)))

print(ans)

Solution (Python):
import math

n = int(input())

nn = int(math.sqrt(n))


fmin = 10
for a in range(1, nn + 1):
  if n % a == 0:
    b = n // a
    fab = max(len(str(a)), len(str(b)))
    if fmin >= fab:
      
      fmin = fab

print(fmin)

Solution (Python):
N=int(input())
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
                divisors.append((i,n//i))
                
    
    return divisors
D=make_divisors(N)
print(max(len(str(D[-1][0])),len(str(D[-1][1]))))

Solution (Python):
n = int(input())

import math
m = int(math.sqrt(n))

ans = 100000000000

for i in range(1,m+1):
	if n%i == 0:
		a = int(n/i)
		b = i
		c = max(a,b)
		
		if len(str(c)) < ans:
			ans = len(str(c))

print(ans)