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, os, math, bisect, itertools, collections, heapq, queue

from decimal import Decimal
from collections import defaultdict



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 f(A, B):
    return max(len(str(A)), len(str(B)))


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

    N = ii()
    ret = MAX
    for n in range(1, int(math.sqrt(N)) + 1):
        if N % n == 0:
            b = N // n
            r = f(n, b)
            ret = min(r, ret)
    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]
p=make_divisors(N)
ans=10**9
for i in range(len(p)):
  ans=min(max(len(str(N//p[i])),len(str(p[i]))),ans)
print(ans)

Solution (Python):
def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


n = int(input())
li = make_divisors(n)
li = [(x, n // x) for x in li]

ans = 1 << 60
for x, y in li:
    ans = min(ans, max(len(str(x)), len(str(y))))

print(ans)

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

Solution (Python):
def divisor(n):
  i = 1
  table = []
  while i * i <= n:
    if n % i == 0:
      table.append(i)
      table.append(n//i)
    i += 1
  table = list(set(table))
  return table

n = int(input())

ans = []
for j in divisor(n):
  a = j
  b = int(n/a)
  
  ans.append(max(len(str(a)), len(str(b))))
  
print(min(ans))

Solution (Python):









import os
import sys
from math import sqrt




def F(a, b):
    if len(str(a)) > len(str(b)):
        print(len(str(a)))
    else:
        print(len(str(b)))


def main():
    n = int(input())
    for i in range(int(sqrt(n)+1), -1, -1):
        if n % i == 0:
            a = i
            b = n//i

            F(a, b)
            break


if __name__ == "__main__":
    main()

Solution (Python):
import math
N=int(input())
frac=[]
for i in range(1,math.floor(math.sqrt(N))+1):
  if N%i==0:
    frac.append(len(str(int(N/i))))
if N !=1:
  print(min(frac))
else:
  print(1)

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

    def enum_divisors(n):
        ans = 10**12
        for i in range(1, n+1):
            if i*i > n:
                break
            if n % i == 0:
                v1 = str(i)
                v2 = str(n//i)
                ans = min(ans, max(len(v1), len(v2)))
        return ans

    print(enum_divisors(N))


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
end = int(n**(0.5))+1
ans = len(str(n))

def F(a, b):
    return max(len(str(a)), len(str(b)))
    
for i in range(1, end):
    if n % i == 0:
        ans = min(ans, F(n//i, i))
print(ans)

Solution (Python):
import math

n = int(input())
output = n
for index in range(int(math.sqrt(n)), 0, -1):
    if n % index == 0:
        output = n // index
        break
print(len(str(output)))

Solution (Python):
N = int(input())
ANS = 10**10 + 2
i = 1
while i * i <= N:
    if (N % i == 0):
        
        max_len = max(len(str(i)),len(str(int(N / i))))
        ANS = min(ANS, max_len)

    i += 1

print(ANS)

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

def digit(n):
    l = 0
    while n:
        l += 1
        n //= 10
    return l

ans = 100
i = 1
while i ** 2 <= n:
    if n % i == 0:
        
        ans = min(ans, max(digit(i), digit(n // i)))
    i += 1
print(ans)

Solution (Python):
from math import floor

def main():
    n = int(input())
    nsq = floor(n ** 0.5)
    r = 11
    for nsqe in range(nsq, 0, -1):
        if n % nsqe == 0:
            rt = max(len(str(nsqe)), len(str(n // nsqe)))
            r = min(r, rt)
    print(r)

if __name__ == '__main__':
    main()

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

for i in range(int(pow(N, 1/2)), 0, -1):
  if N%i == 0:
    print(max(len(str(i)), len(str((N//i)))))
    break

Solution (Python):
from math import sqrt
n=int(input())
sn=int(sqrt(n)//1)

for i in range(sn,0,-1):
    if n%i==0:
        s=n//i
        break
    
print(len(str(s)))

Solution (Python):
from math import sqrt
n=int(input())
sn=int(sqrt(n)//1)

for i in range(sn,0,-1):
    if n%i==0:
        s=n//i
        break
    
print(len(str(s)))

Solution (Python):


def II(): return int(input())
def MII(): return map(int, input().split())
def LII(): return list(map(int, input().split()))

def main():
    N = II()

    mn = 10**10
    for i in range(1, int(N**0.5)+1):
        if N % i == 0:
            mn = min(len(str(N // i)), mn)

    print(mn)

if __name__ == '__main__':
    main()

Solution (Python):
from math import sqrt
N = int(input())
ans = 10000

for i in range(1,int(sqrt(N))+10):
    if N%i == 0:
        m = max(len(str(i)),len(str(N//i)))
        if m < ans:
            ans = m
print(ans)

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

for i in range(1,N+1):
    if(N%i==0):
        j=int(N/i)
        ans=max(len(str(i)),len(str(j)))

    if(N<i**2):
        break
print(ans)

Solution (Python):
def dv(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())
L=dv(N)
if L==[1]:
  L=[1,1]
ans=10**10
for l in L:
  ans=min(ans,len(str(max(l,N//l))))
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
div_arr = make_divisors(N)

if len(div_arr) == 1:
    print(1)
elif len(div_arr) == 2:
    ans_num = max(div_arr)
    print(len(str(ans_num)))
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Solution (Python):
import math

N = int(input())

i = int(math.sqrt(N))
m = N % i

while m != 0:
    i -= 1
    m = N % i

A = int(math.log10(i))
B = int(math.log10(N//i))

res = max(A,B) + 1

print(res)

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

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


can=make_divisors(n)

ans=10**9

for g in can:
    
    ans=min(ans,max(len(str(g)),len(str(n//g))))


print(ans)

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

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction

sys.setrecursionlimit(int(pow(10,6)))


mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]



N=l()[0]
F=10**10

for i in range(1,int(N**0.5)+2):
    if N%i==0:
        F=min(F,max(len(str(i)),len(str(N//i))))
print(F)

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

def checkDisits(a, b):
    a = str(a)
    b = str(b)
    return max(len(a), len(b))

start_num = int(math.sqrt(N))


for i in range(start_num, 0, -1):
    if N % i == 0:
        a = i
        b = N // i
        break

output = checkDisits(a, b)
print(output)

Solution (Python):
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
divlist =  [0] + make_divisors(n)
print(len(str(divlist[divlist.index(divlist[-1])//2 + 1])))

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

for i in range(int(N**(1/2)), 0, -1):
    if N%i == 0:
        len_i = len(str(i))
        len_j = len(str(N//i))
        print(max(len_i, len_j))
        break

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

ans=11

for i in range(1,int(math.sqrt(N))+1):
    if N%i !=0:
        continue
    else:
        A=N//i
        A=str(A)
        i=str(i)
        F=max(len(A),len(i))
        if F<ans:
            ans=F

print(ans)

Solution (Python):



def digit(k,c=0):
    if k == 0:
        return c
    else:
        return digit(k//10,c+1)

def solve(n):
    l = []
    for i in range(round(n**(1/2))):
        a = i+1
        if n % a != 0:
            continue
        b = n // a
        l.append(max(digit(a),digit(b)))
    return min(l)



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

if __name__ == '__main__':
    main()

Solution (Python):
import math
N= int(input())
mn = 100
ref = 100
for i in range(1,int(math.sqrt(N))+1):
    if N%i == 0:
        
        ref = max(len(str(i)),len(str(int(N/i))))
        
        if ref < mn:
            mn = ref
print(mn)

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

A = []
B = []
i = 1

while i*i <= N:
  if N % i == 0:
    A.append(i)
    B.append(N//i)
  i += 1

rlt = 13
for b in B:
  rlt = min(rlt,len(str(b)))

print(rlt)

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

Solution (Python):
n = int(input())
l = []

for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        l.append(max(len(str(a)), len(str(b))))

print(min(l))

Solution (Python):
n = int(input())
l = []

for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        f = max(len(str(a)), len(str(b)))
        l.append(f)

print(min(l))

Solution (Python):
N=int(input())
result=0
count = 1
while count*count <= N:
  if N % count == 0:
    result=count
  count+=1
print(len(str(N//result)))

Solution (Python):
n=int(input())
i=1
while i*i<=n:
    if n%i==0: ans=i
    i+=1
print(len(str(n//ans)))

Solution (Python):
n=int(input())
import math
root_n = math.floor(pow(n,0.5))
ans = len(str(n))
for i in range(root_n,0,-1):
  if n%i==0:
    print(len(str(n//i)))
    exit()
print(ans)

Solution (Python):
n=int(input())
l=int(n**0.5)+1
m=10**10
for i in range(1,l+1):
	if n%i==0:
		a=len(str(i))
		b=len(str(n//i))
		m=min(m,max(a,b))
print(m)

Solution (Python):
import math
N = int(input())
figure = []
for i in range(1, int(math.sqrt(N))+1):
  if N % i == 0:
    figure.append([i, N/i])
  else:
    continue
cnt_list = []
for l in range(len(figure)):
  cnt = 1
  Max = max(figure[l])
  while Max // 10 >= 1:
    cnt += 1
    Max /= 10
  cnt_list.append(cnt)
print(min(cnt_list))

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

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

ans = 10**10
i = 1
while i*i <= n:
    
    if n%i==0:
        ans = min(ans, f(i, n//i))
        
    i+=1
    
print(ans)

Solution (Python):

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
fac_list = factorization(n)

p = []
for i in range(len(fac_list)):
    for j in range(fac_list[i][1]):
        p.append(fac_list[i][0])

l = n
for i in range(2 ** len(p)):
    a = 1
    for j in range(len(p)):
        if ((i >> j) & 1):
            a *= p[j]
    b = int(n/a)
    l = min(l, max(len(str(a)),len(str(b))))
print(l)

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

Solution (Python):
import math


N = int(input())

AB = []

for a in range(1, int(N ** 0.5) + 1):
    if N % a == 0:
        b = math.log10(N // a) + 1
        a = math.log10(a) + 1
        AB.append((a, b))

ans = min([max(a, b) for a, b in AB])
print(int(ans))

Solution (Python):
import sys

def isPrime(n):
    isP = True
    i = 2
    while i*i <= n :
        if n % i == 0:
            isP = False
        i += 1
    
    return isP

def keta_chk(n):
    keta = 0
    while n > 0:
        keta += 1
        n = int(n/10)
    
    return keta

def solve(n):
    ans = sys.maxsize
    i = 1
    while i*i <= n:
        if n % i == 0:
            f = max(keta_chk(int(n/i)),keta_chk(i))
            ans = min(f,ans)
        i += 1
    
    return ans

n = int(input())
ans = solve(n)
print(ans)

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

    m = int(n ** 0.5)
    if n < 4:
        m += 1

    min_f = len(str(n))

    for i in reversed(range(1, m + 1)):
        if n % i == 0:
            b = n // i
            db = len(str(b))
            di = len(str(i))
            f = max(db, di)
            if f < min_f:
                min_f = f

    print(min_f)


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
def factorization(n): 
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            for _ in range(cnt):
                arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr
ls = factorization(n)
mn = float("inf")
for i in range(2**len(ls)):
    a = 1
    for j in range(len(ls)):
        if (i>>j)&1:
            a *= ls[j]
    if a <= n**(1/2):
        b = int(n/a)
        m = max(len(str(a)),len(str(b)))
        if m < mn:
            mn = m
print(mn)

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

class Factorization:	
	def __init__(self):
		
		self.__factors = dict()
		self.__n = 0
	
	
	def get_factors(self, n):
		
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			
			return { n:1 }
		else:
			self.__factorization()
			
			return self.__factors
	
	
	def get_divisors(self, n):
		
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return [1]
		else:
			self.__factorization()
			divisors = [1]
			
			for k, v in self.__factors.items():
				import copy
				copy_ = copy.deepcopy(divisors)
								
				for i in range(1, v + 1):
					for c in copy_:
						divisors.append(c * (k ** i))
			
			return divisors

				
	def count_divisors(self, n):
		
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return 1
		else:
			self.__factorization()
			count = 1
			
			for v in self.__factors.values():
				count *= v + 1
			
			return count
	

	def	__factorization(self):
		
		
		
		
		
		self.__divide_with(2)
		self.__divide_with(3)
		self.__divide_with(5)
			
		
		
		import math
		sqrt_ = math.floor(math.sqrt(self.__n))
			
		primes = [7, 11, 13, 17, 19, 23, 29, 31]
		i = 0
		is_break = False
			
		while self.__n > 1:
			for p in primes:
				if p + i <= sqrt_:
					self.__divide_with(p + i)
				else:
					
					is_break = True
						
					
					if self.__n > 1:
						self.__factors.setdefault(self.__n, 1)
				
			if is_break:
				break
			else:
				i += 30
	
	
	def __divide_with(self, d):
		count = 0
		
		while self.__n % d == 0:
			self.__n //= d
			count += 1
		
		if count > 0:
			self.__factors.setdefault(d, count)



n = int(input())

lib = Factorization()
divisors = lib.get_divisors(n)
divisors.sort()

ans = len(str(n))

for a in divisors:
	if a > n / 2:
		break
	else:
		b = n // a
		f = max(len(str(a)), len(str(b)))
		ans = min(ans, f)

print(ans)

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())

ans = 10 ** 9
i = 1
while i * i <= n:
    if n % i == 0:
        ans = min(ans, max(len(str(i)), len(str(n // i))))
    i += 1
print(ans)

Solution (Python):
import sys
from collections import deque
from itertools import *


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


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


N = I()
ans_list = []
divi_list = make_divisors(N)

for i in range(len(divi_list)):
    for q in range(len(divi_list)):
        if divi_list[i] * divi_list[q] == N:
            ans_list.append(
                max(len(str(divi_list[i])), len(str(divi_list[q]))))
print(min(ans_list))

Solution (Python):
n = int(input())
m = int(pow(n,0.5))
a = 0
for i in range(m):
    k = m-i
    if n%k == 0:
        a = k
        break
print(len(str(max(a,n//a))))

Solution (Python):
def resolve():
    import math
    N = int(input())
    A = []
    B = []
    for i in range(1, math.floor(math.sqrt(N))+1):
        if N%i == 0:
            A.append(i)
            B.append(N//i)
    print(max(len(str(A[-1])), len(str(B[-1]))))
resolve()

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


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


N = int(input())
ans = float("inf")
for n in enum_divisors(N):
    ans = min(ans, F(n, N // n))
print(ans)

Solution (Python):
N = int(input())
min = 10**10
for i in range(1, int(N**0.5+1)):
    if N % i == 0:
        b = N // i
        if i <= b and len(list(map(int, str(b)))) < min:
            min = len(list(map(int, str(b))))
        elif i > b:
            break

print(min)

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

ans = len(str(n))
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 score(x):
    global n
    return len(str(max(x, n//x)))

ans = len(str(n))

for i in range(1, int(n ** 0.5) + 2):
    if n % i == 0:
        ans = min(ans, score(i))

print(ans)

Solution (Python):
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())

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

print(ans)

Solution (Python):
N = int(input())
count = []

for a in range(1,int(N**0.5+1)):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))

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

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def digit(n):
    i = 0
    while n != 0:
        n = n // 10
        i += 1
    return i

divisor_list = make_divisors(N)

length = len(divisor_list)

if length % 2 == 0:
    ans = max(digit(divisor_list[length//2 - 1]),digit(divisor_list[length//2]))
else:
    ans = digit(divisor_list[length//2])

print(ans)

Solution (Python):
import math

import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit


ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
    i = 1
    mi = -1
    while i**2 <= n:
        if n%i == 0:
            a = str(i)
            b = str(n//i)
            mi = max(len(a),len(b))
        i += 1
    print(mi)


    return

if __name__ == '__main__':
    main()

Solution (Python):
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

from itertools import combinations
from functools import reduce
from operator import mul

N = int(input())
p = prime_factorize(N)
ans = len(str(N))
for i in range(1,len(p)//2+1):
    for x in combinations(p,i):
        t1 = reduce(mul,x)
        t2 = N // t1
        ans = min(ans,max(len(str(t1)),len(str(t2))))
print(ans)

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

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            upper_divisors.append(n//i)
        i += 1
    return lower_divisors , upper_divisors

l,u=make_divisors(n)

print(len(str(u[-1])))

Solution (Python):



N = int(input())


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


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
a = 1
b = n
for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        a = i
        b = n // i
      

c = max(a, b)
print(len(str(c)))

Solution (Python):
from math import sqrt

N = int(input())

ans = float('inf')

for a in range(1, int(sqrt(N)) + 1):
  if N % a == 0:
    A = str(a)
    B = str(N // a)
    F = max(len(A), len(B))
    ans = min(ans, F)

print(ans)

Solution (Python):
n=int(input())
divisors = []    
i = 1
while i*i <= n:
    if n % i == 0:
        divisors.append(i)
    i += 1
print(len(str(n//divisors[-1])))

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

def make_divisors(n):
    l_d,u_d=[],[]
    i=1
    while i**2<=n:
        if n%i==0:
            l_d.append(i)
            if i!=n//i:
                u_d.append(n//i)
        i+=1
    return l_d

l_d=make_divisors(n)
ans=10**9
for j in l_d:
    ans=min(ans,max(len(str(j)),len(str(n//j))))
print(ans)

Solution (Python):
N = int(input())
A = []
for i in range(int(N**0.5)):
  if N%(i+1) == 0:
    A.append(i+1)
print(len(str(int(N/A[-1]))))

Solution (Python):
def p(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
def P(L):
  P = 1
  for c in range(len(L)):
    P = P*L[c]
  return P  
N = int(input())
A = p(N)
F = []
for i in range(2**(len(A))):
  B = []
  C = []
  for j in range(len(A)):
    if(i>>j&1):
      B.append(A[j])
    else:
      C.append(A[j])
  F.append(max(len(str(P(B))),len(str(P(C)))))
  
print(min(F))

Solution (Python):
from math import sqrt
N = int(input())
pairs = []
for i in range(int(sqrt(N + 1))):
  if N % (i+1) == 0:
    pairs.append([i+1, N // (i+1)])
print(len(str(max(pairs[-1]))))

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

n = int(input())
def solve():
    for a in divisor(n):
        b = n // a
        yield max(len(str(a)), len(str(b)))

print(min(solve()))

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

n = int(input())
def solve():
    for a in divisor(n):
        b = n // a
        yield max(len(str(a)), len(str(b)))

print(min(solve()))

Solution (Python):
N=int(input())
A_yaku=[]
B_yaku=[]
B_keta=[]
A=1
B=1

while A*A<=N:
    if N % A == 0:
        A_yaku.append(A)
        B=int(N/A)
        B_yaku.append(B)
    A+=1

for i in B_yaku:
    keta=1
    while int(i / 10) != 0:
        i = i / 10
        keta+=1
    B_keta.append(keta)

ans = min(B_keta)

print(ans)

Solution (Python):
import numpy as np
n = int(input())

ans = 1e12
for i in range(1,int(((np.sqrt(n))+1)//1)+1):
    if n%i == 0:
        tmp = len(str(n//i))
        if ans > tmp:
            ans = tmp
        else:
            continue
            
print(ans)

Solution (Python):
def main():
    def f(a, b):
        return max(len(str(a)), len(str(b)))
    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())
    divisors = make_divisors(n)
    ans = float('inf')
    for a in divisors:
        b = n // a
        ans = min(ans, f(a, b))
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
import math
N = 10000
N = 1000003
N = 9876543210

N = int(input())


def calculate(n):
    mid = math.ceil(math.sqrt(n))
    res = -1
    while mid>=0:

        if n % mid == 0:
            s = n // mid
            res =  max(len(str(s)),len(str(mid)))
            break
        mid = mid - 1



    if res== -1:
        print(len(str(n)))
    else:
        print(res)


calculate(N)

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

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


n = int(input())

A = divisors(n); B = A[::-1]

ans = float("inf")
for a, b in zip(A, B):
    tmp = max(len(str(a)), len(str(b)))
    ans = min(ans, tmp)

print(ans)

Solution (Python):
import math
def f(a,b):
  return max(len(str(a)),len(str(b)))

N = int(input())
n = N
ans = N

for _ in range(1,int(math.sqrt(n))+1):
  if n % _ == 0:

    if ans >= f(_,int(N/_)):
      ans = f(_,int(N/_))
    else:
      break
print(ans)

Solution (Python):
def F(A,B):
    if A <= B:
        B = str(B)
        return len(B)
    else:
        A = str(A)
        return len(A)

if __name__ == '__main__':
    import math
    N = int(input())
    min = F(1,N)
    for i in range(1,int(math.sqrt(N))+1):
        if N % i == 0:
            a = F(i,N//i)
            if a < min:
                min = a

    print(a)

Solution (Python):
n = int(input())
sqrt = round(n ** 0.5) + 1
f_min = float('inf')
for i in range(1, sqrt + 1):
    if not n % i:
        a = str(i)
        b = str(n // i)
        f = max(len(a), len(b))
        f_min = min(f_min, f)
print(f_min)

Solution (Python):
import math

n=int(input())
for i in range(int((n**0.5+1)//1),0,-1):
    if n/i%1==0:
        f=max(len(str(i)),len(str(n//i)))
        break
print(f)

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

A = 0
min_score = len(str(N))

while True:

    A += 1

    if A * A > N:
        break

    if N%A != 0:
        continue

    B = N//A

    
    cur = max([len(str(A)), len(str(B))])
    if min_score > cur:
        min_score = cur

print(min_score)

Solution (Python):
import math
import sys
INFTY=sys.maxsize

def readinput():
    n=int(input())
    return n

def main(n):
    fmin=INFTY
    m=int(math.sqrt(n))+1
    for a in range(1,m+1):
        if(n%a==0):
            b=n//a
            f=max(len(str(a)), len(str(b)))
            fmin=min(fmin,f)
    return fmin

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

Solution (Python):
N = int(input())
x = int(N**.5)
while N%x:
  x-=1

print(len(str(N//x)))

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

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

Solution (Python):
def divisor(n): 
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table



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

list_divisor = divisor(N)

for a in list_divisor:
    b = N // a
    len_a = len(str(a))
    len_b = len(str(b))
    ans.append(max(len_a,len_b))

print(min(ans))

Solution (Python):
import math

def main():
    N = int(input())
    ans_list = []
    temp =int(math.sqrt(N) // 1)

    for i in range((temp + 1)):
        if i == 0:
            continue
        elif (N % i) != 0:
            continue
        elif (N % i) == 0:
            ans_list.append([i, N/i])
    result =ans_list[len(ans_list) - 1][1]

    j = 1
    while True:
        result = result // 10
        if result == 0:
            return j
        j += 1

print(main())