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



Sample input:
10000


Sample output:
3

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n=int(input())
l=math.floor(math.sqrt(n))
k=math.floor(math.log10(n))+1
#print(k)
#print(math.log10(n))
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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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))
# print(make_divisors(N))
# print(make_divisors(N))
# print(make_divisors(N))
# print(len(make_divisors(N)))
# print(make_divisors(N)[len_div // 2])

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(make_divisors(N)[len_div // 2])
print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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(divs)
#print( max( divs[len(divs)-1],divs[len(divs)-2] ) )
print( len( str( max( divs[len(divs)-1],divs[len(divs)-2] ) ) ) )

Submission status: Accepted

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

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

    # 1とその数はデフォで入れとく
    s = {1, N}
    # 終点はルート切り捨て
    for i in range(2, int(sqrt(N))+1):
        # 割り切れるなら、iとN/iを追加
        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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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())
print(len(str(make_divisors(N)[-1])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc057/tasks/abc057_c
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)

Submission status: Accepted

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

    # divisors.sort()
    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()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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

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)

Submission status: Accepted

Solution code:
#n 10**10
#sqrtn 10**5
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)

Submission status: Accepted

Solution code:
# coding: utf-8
# Here your code



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)

Submission status: Accepted

Solution code:
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()

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
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))))

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
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)

Submission status: Accepted

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

    # divisors.sort()
    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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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)
#print(l)

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

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

Submission status: Accepted

Solution code:

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)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import itertools

# Return a list of the prime factors for a natural number bigger than 1
def trial_division(n):
    if n < 2:
        return []

    prime_factors = []

    for i in range(2, int(n**0.5)+1):
        # nがi（の累乗）で割り切れるかを調べる
        while n % i == 0:
            # nがiで割り切れる場合、iを素因数としてリストに追加する
            prime_factors.append(i)
            # nをiで割った商で更新しておく
            n //= i
    # nの平方根より大きい素因数が存在する場合
    if n > 1:
        prime_factors.append(n)

    return prime_factors

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

# print('pf:', pf)

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

    for comb in combs:
        # print('comb:', comb)
        temp = 1
        for num in comb:
            temp *= num
        numSet.add(temp)

numSet.add(1)
# print('numSet:', numSet)

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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_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)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

nn = int(math.sqrt(n))
# print(nn)

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:
      # print(fab, a, b)
      fmin = fab

print(fmin)

Submission status: Accepted

Solution code:
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))
                
    # divisors.sort()
    return divisors
D=make_divisors(N)
print(max(len(str(D[-1][0])),len(str(D[-1][1]))))

Submission status: Accepted

Solution code:
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)
		#print(a,b,c)
		if len(str(c)) < ans:
			ans = len(str(c))

print(ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    m = int(n**0.5)
    ans = 10e8+7
    astr = ""
    bstr = ""
    alen = 0
    blen = 0
    for a in range(1,m+1):
        if n%a == 0:
            b = n//a
            astr = str(a)
            bstr = str(b)
            alen = len(astr)
            blen = len(bstr)
            if alen > blen:
                if ans > alen:
                    ans = alen
            else:
                if ans > blen:
                    ans = blen
    print(ans)

            

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
#x1, y1, x2, y2 = map(int,input().split())

sq = int(pow(n , 0.5) + 0.0001)
for i in range(sq, 0, -1):
    if n % i == 0:
        j = n // i
        m = max(len(str(i)), len(str(j)))
        print(m)
        quit()

Submission status: Accepted

Solution code:
from math import sqrt, floor, log10
n = int(input())
for i in range(floor(sqrt(n)), 0, -1):
    if n % i == 0:
        break
print(floor(log10(max(i, n // i))) + 1)

Submission status: Accepted

Solution code:
import math
n = int(input())
min_len = 15
for i in range(1, int(math.sqrt(n)+1)):
    if n % i == 0:
        k = list(map(str, [n//i, i]))
        min_len = min(min_len, len(max(k, key = lambda x:len(x))))
print(min_len)

Submission status: Accepted

Solution code:
n = int(input())

def get_keta(x):
    return len(str(x))

ans = float('inf')
for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        ans = min(ans, max(get_keta(i), get_keta(n // i)))

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

def keta(x):
    k = 0
    while(x>0):
        k+=1
        x = int(x/10)
    return k

s=[]
for i in range(1,int(n**0.5)+1):
    if n%i != 0:
        continue
    b=n/i
    f_ab=max(keta(i),keta(b))
    s.append(f_ab)
print(min(s))

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 10**6
for i in range(1,int(math.sqrt(N)) + 1):
    tmp = max(len(str(i)),len(str(N//i)))
    if N % i == 0 and tmp < ans:
        ans = tmp
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
ans=20
def digits(n):
  return len(str(n))
for i in range(1,int(N**(1/2))+1):
  if N%i==0:
    a=N//i
    ans=min(ans,max(digits(i),digits(a)))
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(a):
    if a < 10: return 1
    return f(a//10) + 1
n = int(input())
a = 0
ans = f(n)
while a * a <= n:
    a += 1
    if n % a > 0: continue;
    b = n // a
    ans = max(f(a), f(b))
    
print(ans)

Submission status: Accepted

Solution code:
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

li = make_divisors(n)
min_dig = 100

for i in range(len(li)):
    a = li[i]
    di_a = len(str(a))
    b = int(n/a)
    di_b = len(str(b))
    digit = max(di_a, di_b)
    if digit <= min_dig:
        min_dig = digit

print(min_dig)

Submission status: Accepted

Solution code:
def number(a):
    m=10**10
    MAX=int(a**0.5)+1
    for i in range(1,MAX):
        if(a%i==0):
            b=len(str(i))
            c=len(str(a//i))
            m=min(m,max(b,c))
    return m

N=int(input())
print(number(N))

Submission status: Accepted

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

t = int(math.sqrt(n))
a, b = 1, n

for i in range(t):
  if n%(t-i) == 0:
    a = t-i
    b = n // (t-i)
    break

keta_a = math.floor(math.log10(a)+1)
keta_b = math.floor(math.log10(b)+1)

print(max(keta_a, keta_b))

Submission status: Accepted

Solution code:
import math

N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
cnt=[]
for i in range(1,int(n**(1/2))+1000):
    if n%i==0:
        cnt.append(n//i)
        cnt.append(i)
#print(cnt)
ans=[]
for j in range(len(cnt)//2):
    a=list(str(cnt[2*j]))
    b=list(str(cnt[2*j+1]))
    ans.append(max(len(a),len(b)))
print(min(ans))

Submission status: Accepted

Solution code:
N=int(input())

temp = int(N**(1/2))

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

Submission status: Accepted

Solution code:
import math

n = int(input())
i = int(math.sqrt(n))
while i>0:
  if n%i==0:
    print(len(str(int(n/i))))
    break
  i-=1

Submission status: Accepted

Solution code:
import math

n = int(input())

f = int(math.log10(n))+1
for i in range(1,int(math.sqrt(n))+1):
	if n%i == 0:
		a = i
		b = n//i
		
		if f > max(int(math.log10(a))+1, int(math.log10(b))+1):
			f = max(int(math.log10(a))+1, int(math.log10(b))+1)

print(f)

Submission status: Accepted

Solution code:
from sys import stdin

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

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

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

li = make_divisors(n)
mi = len(str(n))

for i in li:
    a = i
    b = n//a
    keta = max(len(str(a)),len(str(b)))
    mi = min(mi,keta)

print(mi)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, int(math.sqrt(N)) + 1):
    y = N // i
    if i > y:
        break
    if N % i == 0:
        B = y

print(len(str(B)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    sqrt = math.sqrt(N)
    ans = len(str(N))
    for i in range(1, int(sqrt) + 2):
        if N % i == 0:
            a = i
            b = N // i
            ans = len(str(b))
        else:
            continue
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 100
i = 1
while i <= N**0.5:
    if N%i == 0:
        ans = min(ans, F(i, N//i))
    i += 1
    
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=10**10
for i in range(1,round(math.sqrt(n+1))+5):
  if n%i==0:
    a=max(len(str(i)),len(str(n//i)))
    if a<ans:
      ans=a
print(ans)

Submission status: Accepted

Solution code:
#C
import math
N = int(input())
n = math.ceil(math.sqrt(N))

yaku = []
for i in range(n):
    I = i+1
    if N%I == 0:
        yaku.append(I)
        
ans = 11
for y in yaku:
    a,b = y,N//y
    ast = str(a)
    bst = str(b)
    ans = min(ans,max(len(ast),len(bst)))

print(ans)