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


"""考え方
[入力例１]
10000

N = A * B より

A=10000, B=1
A=5000, B=2
A=2500, B=4
A=1250, B=8
A=1000, B=10
A=500, B=20
A=250, B=40
A=125, B=80
A=100, B=100
A=50, B=200  <-- ここまで来ると、Bの桁数が大きくなるいっぽうなので、最小値が更新されることはもうない
...

つまり、i = 1 ~ √N までを全探索しても、N<=10**10なので、計算量は高々10**5 これは間に合う。

"""
import math

def F(A, B):
    """ 10進表記における、Aの桁数とBの桁数のうち大きい方を返す """
    def keta(n):
        """ 桁数を求める """
        ans = 1
        while True:
            n = n // 10
            if n == 0:
                break
            ans += 1
        return ans
    
    return max(keta(A), keta(B))
    

def solve():
    N = int(input())
    ans = float("inf")

    for i in range(1, math.ceil(math.sqrt(N))+1):
        A = i
        if N%A != 0: continue
        B = int(N/A)

        ans = min(ans, F(A, B))

    print(ans)

if __name__ == "__main__":
    solve()

Solution (Python):
import math
n = int(input())
result = []
for a in range(1, int(math.sqrt(n))+1):
  if n%a != 0:
    continue
  b = n // a
  result.append(len(str(max(a, b))))
print(min(result))

Solution (Python):
from math import sqrt
N=int(input())
ans=10**11
for i in range(1,int(sqrt(N))+1):
    if N%i==0:
        A,B=i,N//i
        A=max(A,B)
        ans=min(ans,len(str(A)))
print(ans)

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

ans=0

for i in range(1,x+1):
    if n%i==0:
        ans=max(i,n//i)

print(len(str(ans)))

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

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

Solution (Python):
n=int(input())
div=[]
for i in range(1,int(n**0.5)+1):
	if n%i==0:
		div.append(i)
		if i!=n//i:
			div.append(n//i)
MIN=float('inf')
for i in div:
	tmp=str(n//i)
	MIN=min(MIN,int(max(len(str(i)),len(tmp))))
print(MIN)

Solution (Python):
N=int(input())
M=int((N**(1/2)))
print(min([max([len(str(i)),len(str(int(N/i)))]) for i in range(1,M+1) if N%i==0]))

Solution (Python):
N=int(input())
M=int((N**(1/2)))
mult=0
while 1:
    for i in [-1,1]:
        x=M+i*mult
        if not N%x:
            print(max([len(str(x)),len(str(int(N/x)))]))
            exit()
    mult+=1

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

Solution (Python):
n=int(input());print(min(len(str(n//a))for a in range(1,int(n**.5)+1)if n%a<1))

Solution (Python):
n=int(input());print(min(len(str(n//a))for a in range(1,int(n**.5)+1)if n%a<1))

Solution (Python):
def divisible_length(n):
    min_length = len(str(n))
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            min_length = min(min_length, max(len(str(i)), len(str(n // i))))
    return min_length

n = int(input())
print(divisible_length(n))

Solution (Python):
n = int(input())
def calc(a,b):
    return max(len(str(round(a))),len(str(round(b))))
L = 11
x = int(round(n**(1/2)))
for y in range(1,x+1):
    if n % y == 0:
        if L > calc(n/y,y):
            L = calc(n/y,y)
print(L)

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

    return sorted(ds)


n = int(input())
minf = 1e9
for d in divisors(n):
    minf = min(minf, max(len(str(d)), len(str(n // d))))

print(minf)

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

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

min_num = 100
while num < n ** (1/2) + 1:
    if n % num == 0:
        min_num = min(min_num, f(n, num))
    num += 1
print(min_num)

Solution (Python):
from math import floor

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

n = int(input())

ans = 10

sup = floor(pow(n,1/2))
for p in range(1,sup+1):
    if n % p == 0:
        ans = min(ans,func(p,n//p))

print(ans)

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

Solution (Python):

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

N = int(input())
a = make_divisor(N)

ans = 100
for i in range(len(a)):
    F = max(len(str(a[i])), len(str(N // a[i])))
    ans = min(ans, F)

print(ans)

Solution (Python):

def func(num):
    cnt=0
    while(num>0):
        num=int(num/10)
        cnt+=1
    return cnt

N=int(input())
ans=100

for i in range(1,int(N**(1/2)+1)):
    
    tmp=100
    if(N%i==0):
        
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
print(ans)

Solution (Python):
def func(num):
    cnt=0
    while(num>0):
        num=int(num/10)
        cnt+=1
    return cnt

N=int(input())
ans=100
for i in range(1,int(N**(1/2)+1)):
    tmp=100
    if(N%i==0):
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
print(ans)

Solution (Python):
import math

N = int(input())
 
def divisor(N):
    '''
    create divisor_list < sqrt(N) from natural number
    '''
    divisor_list = []
    
    for num in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % num == 0:
            divisor_list.append(num)
    
    return divisor_list
    
def F(A, B):
    return max(len(str(A)), len(str(B)))
  
def minimumF(N):
    factoring_list = divisor(N)
    
    candidate_list = []
    
    for A in factoring_list:
        B = N // A
        candidate_list.append(F(A, B))
        
    return min(candidate_list)
  
print(minimumF(N))

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

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

Solution (Python):
N = int(input())
for i in range(int(N**(1/2)), 0, -1):
    if N % i == 0:
        print(len(str(N//i)))
        exit()

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

Solution (Python):
ans = 20
n = int(input())
for i in range(1,n+1):
    if i*i>n:
        break
    if n%i==0:
        ans = min(ans,max(len(str(i)),len(str(n//i))))
print(ans)

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

ans = 20

for i in range(1,10**5):
    if N%i==0:
        ans = min(ans,len(str(max(i,N//i))))
print(ans)

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

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

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

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math

mod = 10**9+7

N = int(input())
ans = 10
for i in range(1,round(math.sqrt(N))+1):
    if N % i == 0:
        f = max(i,N//i)
        f = len(str(f))
        ans = min(f,ans)
    else:
        pass
print(ans)

Solution (Python):
n=int(input())
num=10**5+2
ans=[]
for i in range(1,num):
    if n%i==0:
        ans.append(max(len(str(i)),len(str(n//i))))
print(min(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(str(i))
            divisors.append(str(n // i))
    return divisors


divisors = make_divisors(N)
length = [max(len(divisors[i]), len(divisors[i + 1]))
          for i in range(0, len(divisors), 2)]
print(min(length))

Solution (Python):
import math

def all_divisor(n):
    small = [1]
    large = [n]
    for i in range(2, int(n ** 0.5) + 1):
        if not (n % i):
            small.append(i)
            large.append(n//i)
    return large[-1]

n = int(input())
a = all_divisor(n)
print(int(math.log10(a)) + 1)

Solution (Python):
N = int(input())
F = 10
for A in range(1,100000):
    if N % A == 0:
        B = N // A
        if len(str(A)) < len(str(B)):
            if len(str(B)) < F:
                F = len(str(B))
        else:
            if len(str(A)) < F:
                F = len(str(A))
print(F)

Solution (Python):

import string
import sys
from itertools import chain, dropwhile, takewhile
from math import sqrt


def read(
    *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
    def read_word():
        w = lambda c: c in whitespaces
        nw = lambda c: c not in whitespaces
        return f("".join(takewhile(nw, dropwhile(w, it))))

    if not shape:
        return read_word()
    elif len(shape) == 1:
        return [read_word() for _ in range(shape[0])]
    elif len(shape) == 2:
        return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]


def readi(*shape):
    return read(*shape)


def readi1(*shape):
    return [i - 1 for i in read(*shape)]


def readf(*shape):
    return read(*shape, f=float)


def reads(*shape):
    return read(*shape, f=str)


def arr(*shape, fill_value=0):
    if len(shape) == 1:
        return [fill_value] * shape[fill_value]
    elif len(shape) == 2:
        return [[fill_value] * shape[1] for _ in range(shape[0])]


def dbg(**kwargs):
    print(
        ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
        file=sys.stderr,
    )


def main():
    n = readi()

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

    ans = 10 ** 10
    for i in range(1, int(sqrt(n)) + 1):
        d, m = divmod(n, i)
        if m == 0:
            ans = min(ans, f(d, i))
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1
 
N = int(input())
minimum = 15
for num in range(1,int(N**0.5)+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Solution (Python):
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1
 
N = int(input())
minimum = 15
for num in range(1,10**5+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Solution (Python):
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1

N = int(input())
minimum = 15
for num in range(1,int(N/(10**5))+10**5+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

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

m = 11
s = 1
while s * s <= N:
    if N % s == 0:
        m = min(m,max(map(lambda x:len(str(x)),[s,N//s])))
    s += 1

print(m)

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

n=int(input())
arr=sorted(div(n))
l=len(arr)
ans=10**10
for i in range(l):
  t1=arr[i]
  t2=n//t1
  ans=min(ans,max(len(str(t1)),len(str(t2))))
print(ans)

Solution (Python):
import math

N=int(input())

Nmax=round(math.sqrt(N))
Fmin=10000

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

print(Fmin)

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

Solution (Python):
N = int(input())
def keta(n):
    if n<10:return 1
    return 1 + keta(n//10)
def yakusuu(n):
    for i in range(int(n**(0.5)),0,-1):
        if n%i == 0:return n//i
print(keta(yakusuu(N)))

Solution (Python):
import math
N = int(input())
ans = float("inf")
for i in range(1, math.ceil(math.sqrt(N)) + 1):
	if N % i == 0:
		tmp = max(len(str(i)), len(str(N // i)))
		ans = min(ans, tmp)
print(ans)

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

mi = 12
for a in range(1, int(N ** 0.5) + 1):
    if N % a == 0:
        mi = min(mi, max(len(str(a)), len(str(N // a))))
print(mi)

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

Solution (Python):
import math

N = int(input())
ans = 10
for i in range(1, math.floor(math.sqrt(N))+1):
    if N % i == 0:
        ans = min(ans, len(str(max(N // i, i))))
print(ans)

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

ans = 20
for i in range(1, int(N**(1/2)) + 1):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
        if len(str(N//i)) == len(str(i)):
            break

print(ans)

Solution (Python):
import math


N = int(input())
borderNum = int(math.sqrt(N))
ans = float("inf")


for a in range(1, borderNum + 1):
    if N % a == 0:
        b = N // a
        numF = len(str(b))
        ans = min(ans, numF)


print(ans)

Solution (Python):
import math


N = int(input())
borderNum = int(math.sqrt(N))
ans = float("inf")


for a in range(1, borderNum + 1):
    if N % a == 0:
        b = N // a
        numF = max(len(str(b)), len(str(a)))
        ans = min(ans, numF)


print(ans)

Solution (Python):
import math, bisect
N = int(input())
P = [1,N]
for k in range(2,math.floor(math.sqrt(N))+1):
    if N % k == 0:
        P.append(k)
        P.append(N//k)
P = sorted(P)
print(len(str(P[bisect.bisect_left(P,math.sqrt(N))])))

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

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):
import math

N = int(input())

def digits(A):
    ans = 1
    while A >= 10:
        A //= 10
        ans += 1
    return ans

def F(A, B):
    return max(digits(A), digits(B))

ans = 11
for A in range(1, int(math.sqrt(N)) + 1):
    B = N // A
    if A * B == N:
        ans = min(ans, F(A, B))
print(ans)

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

N = int(input())

div = []
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        div.append(i)
        
        p = N // i
        if i != p:
            div.append(p)
        
div.sort()
print(len(str(div[int(len(div) / 2)])))

Solution (Python):
N = int(input())
ans = N
for i in range(1, N):
    if i**2 > N:
        break
    d = 0
    if N % i == 0:
        d = max(len(str(i)), len(str(N//i)))
        ans = min(ans, d)
print(ans)

Solution (Python):
def c(num):
    cnt=0
    while num>0:
        num//=10
        cnt+=1
    return cnt

def main():
    n=int(input())
    ans=10**10
    for i in range(1,int(n**0.5)+1):
        if n%i!=0:
            continue
        b=n//i
        ret=max(c(i),c(b))
        if ans>ret:
            ans=ret
    print(ans)

main()

Solution (Python):
import math

N = int(input())
a = int(math.sqrt(N))
while a > 0:
    if N % a == 0:
        b = N // a
        print(max([len(str(a)), len(str(b))]))
        break
    a -= 1

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


def cnt_digits(n):
    digits = 0

    while n > 0:
        n = n//10
        digits += 1
    return digits


ans = cnt_digits(N)
A = 1
aa = 1000

while N ** 0.5 >= A:
    A = A+1
    if N % A == 0:
        B = N / A
        if aa > max(cnt_digits(A), cnt_digits(B)):
            aa = max(cnt_digits(A), cnt_digits(B))


if aa < ans:
    print(aa)
else:
    print(ans)

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

Solution (Python):
import math
N=int(input())
n=int(math.sqrt(N))
for i in range(1,n+1)[::-1]:
    if N%i==0:print(int(math.log10(N/i))+1);break

Solution (Python):
import math

n = int(input())

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

ans = len(str(n))
for num in range(1, math.ceil(math.sqrt(n))+1):
    if n % num == 0:
        ans = min(ans, func(num, n//num))

print(ans)

Solution (Python):

import math

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


def submit():
    n = read_input()

    factor_cand = int(math.ceil(math.sqrt(n)))

    while n % factor_cand:
        factor_cand -= 1

        if factor_cand == 1:
            nl = len([c for c in str(n)])
            print(nl)
            return

    a = int(n / factor_cand)
    b = int(factor_cand)

    al = len([c for c in str(a)])
    bl = len([c for c in str(b)])

    print(max(al, bl))



if __name__ == '__main__':
    submit()

Solution (Python):
N = int(input())
ans = 10**10 
ans_ = 10**10

divisors = []
for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        divisors.append(i)
        divisors.append(N//i)
        if len(str(N//i))<=ans:
            ans =N//i
            ans_=i
            
if N ==1:
    ans =1
            
print((len(str(ans))))

Solution (Python):
import math
n=int(input())
ans=0

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

print(len(str(ans)))

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

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

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

print(ans)

Solution (Python):
import math
n = int(input())
res = 100
for i in range(1,int(math.sqrt(n))+1):
    if n%i:
        continue
    res = min(res,max(len(str(i)),len(str(n//i))))
print(res)

Solution (Python):
n = int(input())
x = int(n ** 0.5 + 1)
while(True):
    if n % x == 0:
        a = x
        b = n // x
        break
    else:
        x -= 1
print(max(len(str(a)), len(str(b))))

Solution (Python):


x = 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

print(len(str(make_divisors(x)[-1])))

Solution (Python):
def digit(n):
    res = 0
    while n != 0:
        n //= 10
        res += 1

    return res


n = int(input())
resa = 1
for i in range(int(n**(1/2)),1,-1):
    if n/i-n//i == 0:
        resa = i
        break

resb = n // resa

print(max(digit(resa), digit(resb)))

Solution (Python):
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N))+1) :
    A = i
    B = int(N / A)
    if N % A == 0:
        if A >= B :
            m = int(log10(A)) + 1
        else :
            m = int(log10(B)) + 1
        if m < ans :
            ans = m
            
            
print(ans)

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

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

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

print(ans)

Solution (Python):
n=int(input())
l=lambda j:len(list(map(int,str(j))))
for i in range(int(n**.5),0,-1):
  if n%i==0:
    v=max(l(n//i),l(i))
    break
print(v)

Solution (Python):
def ten_count(n):
    cnt=0
    while True:
        n=n/10
        cnt+=1
        if n < 1:
            break
    return cnt

N=int(input())
  
ans_list=[]
for i in range(1,int(N**0.5)+2):
    if N%i==0:
        A=int(i)
        B=int(N/i)
        
        a=ten_count(A)
        b=ten_count(B)
        
        ans_list.append(max(a,b))
        
print(min(ans_list))

Solution (Python):
def digit(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans

N = int(input())

check = 100
for i in range(1, int(1e6)):
    if N % i != 0:
        continue
    if N // i < i:
        break
    j = N // i
    f = max(digit(i), digit(j))
    check = min(check, f)

print(check)

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

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

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

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

Solution (Python):



def main():
    N = int(input())
    divisors = make_divisors(N)
    ans = 10000000000000000000000000

    if pow(divisors[-1], 2) == N:
        ans = kansuu(divisors[-1], divisors[-1])
    else:

        for idx in range(0, len(divisors)-1, 2):
            ans = min(ans, kansuu(divisors[idx], divisors[idx+1]))

    print(ans)


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


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


if __name__ == '__main__':
    main()

Solution (Python):
from math import sqrt

N = int(input())

F = 10**12
for i in range(int(sqrt(N))):
    if N % (i+1) == 0:
        cand = max([len(str(int(i+1))), len(str(int(N/(i+1))))])
        if F > cand:
            F = cand
print(cand)

Solution (Python):
import math
n=int(input())
ans=11
for i in range(int(n**0.5)+3,0,-1):
    if n%i==0:
        ans=min(ans,int(math.log(n/i,10))+1)
print(ans)

Solution (Python):
n = int(input())
if n == 1:
    print(1)
    exit()
a = 1
b = n
for i in range(1, 10**5):
    if n % i == 0:
        if i > n // i:
            print(min(len(str(i)), len(str(b))))
            exit()
        a = i
        b = n // i
print(len(str(b)))

Solution (Python):
import math

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

N = int(input())
min = F(1,N)
rt = int(math.sqrt(N))
for i in range(2,rt+1):
    if N % i != 0:
        continue
    f = F(i,int(N/i))
    if f < min:
        min = f
print(min)

Solution (Python):
import math
n =int(input())
maxp = 1
for i in range(2,int(n ** 0.5) +1):
    if n % i == 0:
        maxp = i
ans = max(int(math.log10(maxp)) + 1, int(math.log10(n // maxp )) + 1)
print(ans)

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

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 pf(s): return print(s, flush=True)

N=_I()

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


ans=inf
for i in range(1,min(N+1,10**5+3)):
	if N%i==0:
		ans=min(ans,F(i,int(N/i)))

print(ans)

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-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 pf(s): return print(s, flush=True)

N=_I()

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


ans=inf
for i in range(1,min(N,10**5+3)):
	if N%i==0:
		ans=min(ans,F(i,int(N/i)))
ans=min(ans, F(1,N))
print(ans)

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

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

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

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

print(ans)

Solution (Python):

import math
N = int(input())
for_max = math.ceil(math.sqrt(N))
ans = 10 ** 18

for i in range(1, for_max + 1):
    if N % i == 0:
        a = N // i
        b = i
        
        func = max(math.log10(a) + 1, math.log10(b) + 1)
        func = int(func)
        ans = min(ans, func)
print(ans)

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

Solution (Python):
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
m = math.ceil(math.sqrt(n))
for i in range(m, -1, -1):
    if n % i == 0:
        print(max(len(str(i)), len(str(n // i))))
        exit()

Solution (Python):

import math
n = int(input())
a = 1
b = 1
for i in range(1, math.floor(math.sqrt(n))+1):
  if n % i == 0:
    a = n / i
    
b = n / a
print(max([len(list(str(int(a)))), len(list(str(int(b))))]))

Solution (Python):
from math import sqrt, ceil

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

    up_b = ceil(sqrt(N))

    min_a = 10 ** 10
    for b in range(up_b):
        if N % (b+1) == 0:
            min_a = min(max(N/(b+1), b+1), min_a)
            min_a = int(min_a)
    
    print(len(str(min_a)))
        
main()

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

def f(a, b):
    a, b = str(a), str(b)
    return len(a) if len(a) > len(b) else len(b)

def isPrime(n):
    if n < 2:
        return False
    elif n == 2:
        return True
    else:
        for i in range(2, int(n**(1/2))+1):
            if n%i == 0:
                return False
        return True

if isPrime(N):
    print(f(N, 1))
else:
    ans = 10**20
    for i in range(1, int(N**(1/2))+1)[::-1]:
        if N%i == 0:
            ans = min(ans, f(N//i, i))
    print(ans)

Solution (Python):
from functools import reduce
import math

def main():
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    
    
    
    
    N = int(input().rstrip())
    ans = 1e10
    d = 0
    for i in range(int(math.sqrt(N))+1,0,-1):
        if(N%i == 0):            
           d = max(len(str(i)) , len(str(N//i))) 
           ans = min(d,ans)
    print(ans)
    
if __name__ == '__main__':
    main()

Solution (Python):
import math

num = int(input())
num_sqrt = int(math.sqrt(num))

ans = 11
for A in range(1, num_sqrt+1):
    if num % A == 0:
        B = int(num / A)
        A, B = str(A), str(B)
        now_ans = max(len(A), len(B))
        ans = min(ans, now_ans)
print(ans)

Solution (Python):
import sys

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


def main():
    input = sys.stdin.readline
    N = int(input())
    n = int(N**0.5)

    ans = 11
    for i in range(1, n+1):
        if N % i == 0:
            ans = min(ans, f(i, N//i))

    return ans


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

Solution (Python):
N = int(input())
A = N
for i in range(2, int(pow(N, 0.5)) + 1):
    if N % i == 0:
        A = N / i
for j in range(1, N + 1):
    if A < 10 ** j:
        print(j)
        exit()

Solution (Python):
import math
N = int(input())
n = int(math.sqrt(N))
ans = float('inf')
for i in range(1,n+1):
  if(N%i == 0):
    a,b = i,N//i
    a,b = str(a),str(b)
    tmp = max(len(a),len(b))
    ans = min(ans,tmp)
print(ans)

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

for i in range(1,a+1):
  if n%i==0:
    b=i

c=str(n/b)
print(len(c)-2)

Solution (Python):
import math

N = int(input())
n = math.ceil(math.sqrt(N))

a = 0
b = 0
for i in reversed(range(1, n+1)):
	if N%i==0:
		a = i
		b = N//i
		break

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

Solution (Python):
import math
n = int(input())
pf_list = []

min_digit = float('inf')
for i in range(1, int(math.sqrt(n))+1):
  if n % i == 0:
    a = len(str(int(i)))
    b = len(str(int(n/i)))
    tmp_list = [a, b]
    tmp_list = list(map(int, tmp_list))
    if min_digit > max(tmp_list):
      min_digit = max(tmp_list)

print(min_digit)

Solution (Python):
import math
n = int(input())
ans = 1e10
for i in range(1, int(math.sqrt(n)) + 1) :
  if(n % i == 0) :
    ans = min(ans, int(math.log10(n/i)))
print(ans+1)

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

for i in range(1,N+1):
    if i * i <= N:
        if N % i == 0:
            ans = i
    else:
        break
print(len(str(N // ans)))

Solution (Python):
N = int(input())
minimum = 10**9
num = []
for i in range(1, int(N**0.5)+1):
    if N%i == 0:
        num.append(i)
for i in num:
    A = i
    B = N//i
    minimum = len(str(max(A,B))) if minimum > len(str(max(A,B))) else minimum
print(minimum)

Solution (Python):
import numpy as np
 
n = int(input())
n_s = int(np.sqrt(n))
 
b = n
a = 1
 
for i in range(2, n_s+1):
  if n % i == 0:
    a = i
    b = n//i
 
print(int(max(np.log10(a), np.log10(b)))+1)

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

import math
X=math.ceil(math.sqrt(N))

FACT=[]
for i in range(1,X+1):
    if N%i==0:
        FACT.append(i)

ANS=10**10

for f in FACT:
    x=N//f
    ANS=min(ANS,max(len(str(x)),len(str(f))))

print(ANS)

Solution (Python):
def getdigit(N):
  cnt = 0
  while(N>0):
    cnt += 1
    N //= 10
  return cnt

N = int(input())
for i in reversed(range(1,int(pow(N, 1/2))+1)):
  if(N % i == 0):
    print(max(getdigit(i), getdigit(N/i)))
    exit()

Solution (Python):


import math




n=int(input())

A=[0]
i=1
while i<=math.sqrt(n):
    if n%i==0:
        A.append(i)
    i+=1
B=[0]
s=[]
for i in range(len(A)-1):
    j=int(n/A[i+1])
    B.append(j)
    a=len(str(A[i+1]))
    b=len(str(B[i+1]))
    s.append(max(a,b))
ans=min(s)
print(ans)

Solution (Python):
import math
N = int(input())
n = int(math.sqrt(N))
p = 1
while True:
  p = N//n
  if n*p == N:
    break
  else:
    n -= 1
print(max(len(str(n)),len(str(p))))

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

Solution (Python):
N = int(input())
def divisor_all(n): 
    import math as ma
    l = [1,n]
    for i in range(2,int(ma.sqrt(n))+1):
        if n % i == 0:
            l.append(i)
            l.append(n//i)
    l.sort()
    return l
ans = float('inf')
m = divisor_all(N)
for i in m:
    j = N // i
    ans = min(ans,max(len(str(i)),len(str(j))))
print(ans)