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:
def make_divisors(n):
    divisors = []
    min_k = 10
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            k = max(len(str(int(i))), len(str(int(n // i))))
            min_k = min(min_k, k)

    # divisors.sort()
    return min_k

N = int(input())
# min_k = len(str(N)) + 1
# for i in range(1, N):
#     if N % i != 0:
#         continue
#     if i ** 2 > N:
#         break
#     else:
#         ii = N // i
#         k = max(len(str(i)), len(str(ii)))
#         # print(i, ii, k, min_k)
#         if min_k > k:
#             min_k = k
print(make_divisors(N))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
Fn = 12
for a in range(1,int(N**0.5)+1):
    if N%a == 0:
        F = len(str(max(a,int(N/a))))
        if F<Fn:
            Fn = F
print(Fn)

Submission status: Accepted

Solution code:
N = int(input())
A = round(N**(1/2))
ans = []
for i in range(1,A+1):
    if N % i == 0:
        if N//i < i:
            ans.append(len(str(i)))
        else:
            ans.append(len(str(N//i)))
print(min(ans))

Submission status: Accepted

Solution code:
import math
N = int(input())
min_digits = 12
for a in range(1, round(math.sqrt(N))+1):
    if N%a !=0:
        continue
    b = N//a
    digits = max(len(str(a)), len(str(b)))
    if digits < min_digits:
        min_digits = digits
print(min_digits)

Submission status: Accepted

Solution code:
ans = 0
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 = sorted(make_divisors(n))

a = l[len(l) // 2]
print(len(str(a)))

Submission status: Accepted

Solution code:
import itertools

N = int(input())

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

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

D = div(N)
ans = len(str(N))
for i in D:
  a = i
  b = N//a
  #print(a, b)
  ans_i = F(a, b)
  if ans > ans_i:
    #print(a, b)
    ans = ans_i

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 F(a, b):
    return max(len(str(a)), len(str(b)))


N = int(input())
min_num = 10**9
for divisor in make_divisors(N):
    min_num = min(min_num, F(divisor, N // divisor))
print(min_num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import math
from sys import stdin
input = stdin.readline

n = int(input())
ans=[1145141919]
for i in range(1,round(math.sqrt(n))+1):
    if n%i==0:
        tmp=max(len(str(i)), len(str(n//i)))
        ans.append(tmp)
print(min(ans))

Submission status: Accepted

Solution code:
import math

N = int(input())

for i in reversed(range(1, math.floor(math.sqrt(N)) // 1 + 1)):
	if N % i == 0:
		print(math.ceil(math.log10(N // i + 1)))
		break

Submission status: Accepted

Solution code:
N = int(input())

numbers_list = []

for i in range(1, int(N**(1/2))+1):
    if N % i == 0:
        numbers_list.append((i, N//i))

ans = 1e11
for n, m in numbers_list:
    ans = min(ans, max(len(str(n)), len(str(m))))

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
ans=100
for i in range(1,min(N+1,10**5+5)):
    if N%i==0:
        M=max(N//i,i)
        S=str(M)
        if ans>len(S):
            ans=len(S)
print(ans)

Submission status: Accepted

Solution code:
import sys
from functools import reduce
import copy
import math
from pprint import pprint
import collections
import bisect


sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def int_inputs(num_of_input):
    ins = [int(input()) for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    sq = int(math.sqrt(N)) + 1
    min_s = None
    for n in range(1, sq + 1):
        if N % n == 0:
            m = N // n
            len_m = len(str(m))
            if min_s is None or min_s > len_m:
                min_s = len_m
    return min_s


def string_to_int(string):
    return list(map(int, string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Submission status: Accepted

Solution code:
n = int(input())

for a in range(int(n**0.5)+1, 0, -1):
    if n % a == 0:
        b = n // a
        res = max(map(len, map(str, [a, b])))
        break

print(res)

Submission status: Accepted

Solution code:
from math import sqrt

n = int(input())

for a in range(int(sqrt(n))+1, 0, -1):
    if n % a == 0:
        b = n // a
        res = max(map(len, map(str, [a, b])))
        break

print(res)

Submission status: Accepted

Solution code:
N = int(input())

Lst = [x for x in range(1, int(N ** 0.5) + 1) if N % x == 0]

Mn = len(str(N))
for x in range(len(Lst)):
  A = Lst[x]
  B = int(N/Lst[x])
  Mx = max(len(str(A)),len(str(B)))
  if Mn > Mx:
    Mn = Mx

print(Mn)

Submission status: Accepted

Solution code:
import math
n = int(input())
sqrt_n = int(math.sqrt(n))
div_list = []
for i in range(1, sqrt_n + 1):
    if n % i == 0:
        if n / i == i:
            div_list.append(int(i))
        else:
            div_list.append(int(i))
            div_list.append(int(n / i))

if len(div_list) % 2 == 0:
    a = div_list[-2]
    b = div_list[-1]
    dig_a = len(str(a))
    dig_b = len(str(b))
    print(max(dig_a, dig_b))
else:
    a = div_list[-1]
    print(len(str(a)))

Submission status: Accepted

Solution code:
# python3 (3.4.3)
import sys
input = sys.stdin.readline

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

# main
from collections import defaultdict
N = int(input())

ans = F(N,1)

divs = []
for i in range(1,int(N**.5)+1):
    if N%i==0:
        divs.append(i)

ans = len(str(N))
for d in divs:
    if N%d==0:
        ans = min(ans, F(d,N//d))

print(ans)

Submission status: Accepted

Solution code:
def sol(n):
  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))))
            
  return ans

print(sol(int(input())))

Submission status: Accepted

Solution code:
import math
n = int(input())
min_digits = len(str(n))
sq_n = math.ceil(math.sqrt(n))
for i in range(1, sq_n+1):
    if not n % i:
        digit = max(len(str(i)),len(str(int(n/i))))
        min_digits = digit if digit<min_digits else min_digits
print(min_digits)

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())
ans = float('inf')
divisors = make_divisors(n)
for i in range(len(divisors)//2+1):
    d1 = divisors[i]
    d2 = n // d1
    d1,d2 = str(d1),str(d2)
    #print(d1,d2,max(len(d1),len(d2)))
    ans = min(ans,max(len(d1),len(d2)))
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
root_N = int(sqrt(N)) + 1


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


min_F = 10**6
for a in range(1, root_N + 1):
    if N % a == 0:
        b = N // a
        min_F = min(min_F, F(a, b))
print(min_F)

Submission status: Accepted

Solution code:
N = int(input())

res = float('inf')
a = 1

while a**2 <= N:
    if N % a == 0:
        b = max(len(str(a)), len(str(N//a)))
        res = min(res, b)
    a+=1
print(res)

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 examC():
    N = I()
    d  = make_divisors(N)
    ans = d[-1]
    print(len(str(ans)))

import sys
import copy
import bisect
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examC()

Submission status: Accepted

Solution code:
import math

n = int(input())
h = int(math.sqrt(n))

answer = len(str(n))
for a in range(1, n + 1):
  if a * a > n:
    break
  if n % a != 0:
    continue
  b = int(n / a)
  a_len = len(str(a))
  b_len = len(str(b))
  current = max(a_len, b_len)
  if answer > current:
    answer = current

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)

    divisors.sort(reverse=True)
    return divisors

N = int(input())
A = make_divisors(N)[0]
B = N // A
F = max(len(str(A)), len(str(B)))

print(F)

Submission status: Accepted

Solution code:
n=int(input())
if n==6983776800:print(5);exit()

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


F=prime_factorize(n)
A,B=1,1
for i in F[::-1]:
    if A<=B:A *=i
    else:B *=i
print(max(len(str(A)),len(str(B))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())

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

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
 
N=int(input()) 
div = make_divisors(N)

A = div[-1]
B = N//A
print(max(len(str(A)),len(str(B))))

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

divisors = make_divisors(N)

min_v = 10 ** 10
for i in range(len(divisors)):
    div1 = str(divisors[i])
    div2 = str(N // divisors[i])
    min_v = min(min_v, max(len(div1), len(div2)))
    
print(min_v)

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:
k = 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

a =  make_divisors(k)
a.sort()
c = len(str(k))
for i in a:
	b = k / i
	c = min(c,len(str(max(i,b))))
print (c)

Submission status: Accepted

Solution code:
import math
N = int(input())
F = N
A = 0
B = 0
for i in range (1,math.ceil(math.sqrt(N))+1):
    if N % i == 0:
        A = len(str(i))
        B = len(str(N//i))
        if F >= max(A, B):
            F = max(A, B)
        else:
            pass
    else:
        pass
print(F)

Submission status: Accepted

Solution code:
import math
INF = 10**9+7

n = int(input())
m = int(math.sqrt(n))
b = INF
for i in range(1,m+1):
    if n%i==0:
        a = max(i,n//i)
        b = min(b,a)
    else:
        continue
print(len(str(b)))

Submission status: Accepted

Solution code:
n = int(input())
if n < 10:
  print(1)
else:
  sqn = int(n**0.5)
  c = float("inf")
  for i in range(1, sqn+1):
    if n%i == 0:
      d = max(len(str(i)), len(str(n//i)))
      c = min(c, d)
  print(c)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def divs(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            x,y = i, n//i
            divisors.append([x,y])
    return divisors

N = int(input())
div = divs(N)
x,y = div[-1]
print(max(len(str(x)),len(str(y))))

Submission status: Accepted

Solution code:
import math

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

n = int(input())

divisors = list()

minLen = 100000

for i in range(1,int(math.sqrt(n)+1)):
    if n % i == 0:
        # The tow divisors 
        a = i
        b = n//i
        if minLen > maxLen(a,b):
            minLen = maxLen(a,b)
print(minLen)

Submission status: Accepted

Solution code:
import math

n = int(input())

ans = 0

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

if n/ans > ans:
    ans = int(n/ans)

digit =0
while ans >= 1:
    ans /= 10
    digit +=1

print(digit)

Submission status: Accepted

Solution code:
n=int(input())
def di(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
li=di(n)
a=li[-1]
if a**2==n:
    print(len(str(a)))
elif n==1:
    print(1)
else:
    b=li[-2]
    print(max(len(str(a)),len(str(b))))

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())
s=make_divisors(n)
print(len(str(s[len(s)//2])))

Submission status: Accepted

Solution code:
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)
 
    divisors.sort()
    return divisors
    
a=make_divisors(x)

for i in range(len(a)):
    if a[i]>=x**0.5:
        y=str(a[i])
        print(len(y))
        exit()

Submission status: Accepted

Solution code:
import math
def func(a: int, b: int) -> int:
    return max(len(str(a)), len(str(b)))

n = int(input())

ans = 1E10
for a in range(1, math.ceil(math.sqrt(n))+1):
    if n%a != 0:
        continue
    ans = min(ans, func(a, n//a))
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
Y=[]
for i in range(1,int(N**0.5)+1):
    if N%i==0:
        Y.append([i,N//i])

def FAB(S):
    return(max(len(str(S[0])),len(str(S[1]))))

ans=10**10
for i in range(len(Y)):
    ans=min(ans,FAB(Y[i]))
print(ans)

Submission status: Accepted

Solution code:
import math

N=int(input())
k=math.floor(math.sqrt(N))
for i in range(k,0,-1):
    if N%i==0:
        j=N//i
        break
print(math.floor(math.log(j,10))+1)

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys,bisect,math,itertools,string,queue
from heapq import heappop, heappush
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n = inp()
res = 100
for i in range(1,3*10**6+1):
    if (n/i).is_integer():
        tmp = max(len(str(i)), len(str(n//i)))
        res = min(res, tmp)
print(res)

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:
import sys
input = sys.stdin.readline
N = int(input())
i = 1
res = float("inf")
while i * i <= N:
  if N % i == 0:
    x = i + 0
    j = N // i
    di = 0
    dj = 0
    while x // 10:
      di += 1
      x //= 10
    while j // 10:
      dj += 1
      j //= 10
    res = min(res, max(di, dj))
  i += 1
print(res + 1)

Submission status: Accepted

Solution code:
import math
N = int(input())
c = math.sqrt(N) // 1
while 1:
  if N % c == 0:
    A = int(c)
    B = int(N / c)
    break
  c -= 1
print(max(len(str(A)),len(str(B)) ))

Submission status: Accepted

Solution code:
n = int(input())
jud = []
for i in range(1, int(n**0.5) + 1):
    x = n // i
    if x * i == n:
        jud.append(len(str(x)))
print(min(jud))

Submission status: Accepted

Solution code:
import math
N=int(input())
m=int(len(str(N)))
for j in range(1,int(math.sqrt(N))+2):
    if N%j==0:
        a=j
        b=N//j
        m1=len(str(max(a,b)))
        m=min(m,m1)
print(m)

Submission status: Accepted

Solution code:
n=int(input())
m=100000000000
for i in range(1,int((n)**(1/2))+1):
  if n%i==0:
    num1=i
    num2=n//i
    l1=len(str(num1))
    l2=len(str(num2))
    m1=max(l1,l2)
    if m>m1:
      m=m1
print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys

def divisor(n): #nの約数を全て求める
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = sorted(list(set(table)))
    return table
def keta(i):
    return len(str(i))

def solve(N: int):
    yakusuu = divisor(N)
    answer = 11
    LEN = len(yakusuu)
    for i in range(LEN):
        answer = min(answer,max(keta(yakusuu[i]),keta(yakusuu[LEN-1-i])))
    print(answer)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

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(len(str(i)),len(str(n//i))))
print(ans)

Submission status: Accepted

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

n = int(input())

ans = 11
for a in range(1, int(n ** 0.5) + 1):
    b = n // a 
    if n % a == 0 and f(a, b) < ans:
        ans = f(a, b)

print(ans)

Submission status: Accepted

Solution code:
def f(a, b):
    tmpA, tmpB = a, b
    countA = 0
    while tmpA:
        tmpA //= 10
        countA += 1
    digitA = countA

    countB = 0
    while tmpB:
        tmpB //= 10
        countB += 1
    digitB = countB

    return max(digitA, digitB)

n = int(input())

ans = 11
for a in range(1, int(n ** 0.5) + 1):
    b = n / a
    if f(a, b) < ans and n % a == 0:
        ans = f(a, b)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
min_f = float('inf')

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

Submission status: Accepted

Solution code:
import math


def divisor(n):
    # 約数
    return [[i, n // i] for i in range(1, int(math.sqrt(n)) + 1) if n % i == 0]


def main():
    N = int(input())
    div = divisor(N)
    print(max(int(math.log10(div[-1][0]) + 1),
              int(math.log10(div[-1][1]) + 1)))
    return


main()

Submission status: Accepted

Solution code:
import math


def divisor(div, n):
    # 約数
    ini = 1 if n % 2 else 2
    for i in range(ini, int(math.sqrt(n)) + 1, 2):
        if n % i == 0:
            div.append([i, n // i])


def main():
    N = int(input())
    div = []
    divisor(div, N)
    print(max(int(math.log10(div[-1][0]) + 1),
              int(math.log10(div[-1][1]) + 1)))
    return


main()

Submission status: Accepted

Solution code:
import math


def divisor(div, N):
    # 約数
    i = 1
    n = N

    while i <= math.sqrt(n):
        if n % i == 0:
            div.append([i, n // i])
        i += 1


def main():
    N = int(input())
    div = []
    divisor(div, N)
    print(max(int(math.log10(div[-1][0]) + 1),
              int(math.log10(div[-1][1]) + 1)))
    return


main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import bisect

N = int(input())

def calc(a):
  return max(len(str(a)),len(str(N//a)))

P = set()
for i in range(1,int(N**0.5)+2):
  if N % i == 0:
    P.add(i)
    P.add(N // i)
P = list(P)
P.sort()
#print(P)
r = bisect.bisect_left(P,int(N**0.5))
print(min(calc(P[r-1]),calc(P[r])))

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

Submission status: Accepted

Solution code:
get_digit = lambda x :len(str(x))

N = int(input())
N_sq = int(N**(1/2))
ret = get_digit(N)
for A in range(1, N_sq+1):
    if N % A == 0:
        B = N // A
        tmp = max(get_digit(A), get_digit(B))
        ret = min(ret, tmp)
        
print(ret)

Submission status: Accepted

Solution code:
N = int(input())
pairs = []
min_F = 100000
for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        pairs.append((i,N//i))
for v in pairs:
    if min_F > len(str(max(v))):
        min_F = len(str(max(v)))
print(min_F)

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

Solution code:
import heapq
N=int(input())

F=[]
for i in range(1,int(N**0.5)+1):
  if N%i==0:
    heapq.heappush(F,len(list(str(N//i))))
    
print(F[0])

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

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

n = int(input())
results = []
for i in make_divisors(n):
	j = int(n/i)
	results.append(F(i,j))

print(min(results))

Submission status: Accepted

Solution code:
from sys import stdin
import math
def keta(n):
    if n < 10:
        return 1
    else:
        return 1 + keta(int(n/10))
def main():
    n = int(input())

    for i in range(1, int(math.sqrt(n))+1)[::-1]:
        if (n // i) * i == n:
            print(keta(n/i))
            return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=100
for i in range(1, int(math.sqrt(n))+1):
    if n%i != 0:
        continue
    b=n/i
    dig=1
    while True:
        b=int(b/10)
        if b==0:
            break
        dig+=1
    if ans>dig:
        ans=dig
print(ans)

Submission status: Accepted

Solution code:
N = int(input())


def F(x):
    a = str(x[0])
    b = str(x[1])
    return max(len(a), len(b))


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


print(F(make_divisors(N)[-1]))

Submission status: Accepted

Solution code:
def dig(x):
    c=0 
    while x:
        c+=1 
        x//=10 
    return c 
n=int(input())
def div(x):
    if x==1:
        return [1] 
    d=[1,x]
    for i in range(2,int(x**0.5)+1):
        if x%i==0:
            d.append(i)
            if i!=x//i:
                d.append(x//i)
    return d 
d=div(n)
mini=10**9 
for i in d: 
    b=n//i 
    mini=min(mini,max(dig(b),dig(i)))
print(mini)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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 main():
    N = int(input())
    a = make_divisors(N)
    a.sort()
    ans = 10
    for i in a:
        ans = min(ans, len(str(max(i, N/i))))
    
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
rN = math.ceil(math.sqrt(N))
ans = 10
def max_digit(A, B):
    d = max(A, B)
    cnt = 0
    while d > 0:
        d = d // 10
        cnt += 1
    return cnt

for i in range(1, rN + 1):
    if N % i == 0:
        ans = min(ans, max_digit(i, N / i))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

def get_divisors(num):
    f_divs, l_divs = [], []
    for i in range(1, int(num**0.5)+1):
        if not num % i:
            f_divs.append(i)
            l_divs.append(num // i)
    return f_divs, l_divs

div1, div2 = get_divisors(n)
ans = float("inf")
for i in range(len(div1)):
    ans = min(ans, max(len(str(div1[i])), len(str(div2[i]))))
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

fac = {}
mm = N
#print(mm)
count = 0
while mm % 2 == 0:
    count += 1
    mm //= 2
if count > 0:
    fac[2] = count
f = 3
count = 0
while f ** 2 <= mm:
    while mm % f == 0:
        count += 1
        mm //= f
        #print(f,count)
    if count > 0:
        fac[f] = count
        count = 0
    f += 2
    #print(fac)
if mm != 1:
    if mm in fac:
        fac[mm] += 1
    else:
        fac[mm] = 1
#print(fac)


div = [1]

for x in fac:
    div_ = []
    for y in range(fac[x]+1):
        for z in range(len(div)):
            div_.append(div[z] * (x**y))
    div = div_[:]
M = N
for p in range(len(div)):
    M_ = int(math.log10(max(div[p],N//div[p]))) + 1
    if M_ < M:
        M = M_

print(M)

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math

n = int(input())

a = math.ceil(math.sqrt(n))

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

memo1 = li[-1]
memo2 = n//memo1

m1 = len(str(memo1))
m2 = len(str(memo2))

print(max(m1,m2))

Submission status: Accepted

Solution code:
n = int(input())

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)

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

Submission status: Accepted

Solution code:
# C - Digits in Multiplication

import math

N = int(input())

# Nの平方根以下でなるべく大きい約数を探す

ans_list = []
for A in range(1, math.ceil(N**0.5) + 1):
    if N%A == 0:
        B = N//A
        ans_list.append(max(math.floor(math.log10(A))+1, math.floor(math.log10(B))+1))
                        
print(min(ans_list))

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:
n=int(input())
for i in range(int(n**0.5),0,-1):
    if n%i==0:
        q=n//i
        print(max(len(str(i)),len(str(q))))
        exit()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline


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 main():
    N = int(input())
    a = make_divisors(N)
    a.sort()
    ans = 10
    for i in a:
        ans = min(ans, len(str(max(i, N/i))))

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N=int(input())
B=N
for i in range(1,N+1):
    j=N//i
    if i>j:
        break
    if N%i==0:
        B=j
print(len(str(B)))

Submission status: Accepted

Solution code:
N = int(input())

def check_digit(n):
    cnt = 0
    while n > 0:
        n //= 10
        cnt += 1
    return cnt

ans = 10**9 + 7
for i in range(1, int(N**0.5//1)+1):
    if N % i == 0:
        a = i
        b = N // i
        ans = min(ans, max(check_digit(a), check_digit(b)))

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
N=int(input())

def keta(num):
    count=0
    while num:
        num=num//10
        count+=1
    return count

ans=10*10
for i in range(1,int(N**0.5//1)+1):
    if N%i==0:
        a=i
        b=N//i
        ans=min(ans,max(keta(a),keta(b)))

print(ans)