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:
import math
N=int(input())
nmax = math.ceil(math.sqrt(N))
i = 1
Bdigimin = 10
while ( i <= nmax):
	if N % i == 0:
		Bdigi = math.floor(math.log10(N/i))
		if Bdigimin > Bdigi:
			Bdigimin = Bdigi
	i += 1
print(int(Bdigimin+1))

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
cond = []
for i in range(1, int(sqrt(N))+1):
    if N % i == 0:
        cond.append((i, N//i))

# print(cond)
ans = 11
for c in cond:
    a, b = map(str, c)
    f = max(len(a), len(b))
    ans = min(ans, f)
    
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
nn = int(n**(1/2))
ans = 15

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

print(ans)

Submission status: Accepted

Solution code:
# encoding: utf-8
import math
N = int(input())

for A in list(range(1, int(math.sqrt(N)) + 1))[::-1]:
    if A > math.sqrt(N): continue
    elif N % A == 0: break
    
B = N // A
# print("#", A, B)
for ans in range(1, 11):
    if B // 10 == 0: break
    B = B // 10

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
array = []

for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        array.append(len(str(N//i)))

print(min(array))

Submission status: Accepted

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

if n == 1:
    print(1)
    sys.exit()

yakusu = []

sq = math.ceil(math.sqrt(n))
for i in range(1, sq + 1):
    if n % i == 0:
        yakusu.append(i)
        yakusu.append(n // i)

yakusu.sort()
for i in range(len(yakusu) // 2 + 1):
    if len(yakusu) - i * 2 <= 1:
        if len(yakusu) - i * 2 == 0:
            ans = yakusu[len(yakusu) - i]
        else:
            ans = yakusu[i]
        for j in range(1, 11):
            if ans // 10 == 0:
                print(j)
                break
            ans //= 10
        sys.exit(0)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = []

def digits(n):
    count = 1
    while n // 10 != 0:
        n = n // 10
        count += 1
    return count

for a in range(1, int(math.sqrt(N)) + 1):
    if N % a == 0:
        b = N // a
        ans.append(max(digits(a), digits(b)))

print(min(ans))

Submission status: Accepted

Solution code:
N = int(input())
numbers = []
for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        digits = max(len(str(i)), len(str(N//i)))
        numbers.append(digits)
print(min(numbers))

Submission status: Accepted

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

N = int(input())

def primes(n):
    primfac = []
    d = 2
    while d*d <= n:
        while (n % d) == 0:
            primfac.append(d)  # supposing you want multiple factors repeated
            n //= d
        d += 1
    if n > 1:
       primfac.append(n)
    return primfac

def F(a,b):
    return max([len(str(a)), len(str(b))])
    
if N == 1:
    print(1)
    exit()
    
l = primes(N)
l.append(1)
ans = []
for i in range(1,len(l)//2+1):
    comb = itertools.combinations(l, i)
    comb = list(set(list(comb)))
    for comblist in comb:
        # print(tmp)
        tmp = 1
        for x in comblist:
            tmp *= x

        ans.append(F(tmp,N//tmp))

# print(ans)
print(min(ans))

Submission status: Accepted

Solution code:
def 解():
    iN = int(input())
    iLim = int(iN**0.5) + 1

    iMinMax = len(str(iN))
    for i in range(iLim+1,0,-1):
        if iN % i == 0:
            iMax = len(str(max(i,iN//i)))
            if iMinMax < iMax :
                print(iMinMax)
                exit()
            else:
                iMinMax = iMax
    print(iMinMax)
解()

Submission status: Accepted

Solution code:

iN = int(input())
iLim = int(iN**0.5) + 1

iMinMax = len(str(iN))
for i in range(iLim+1,0,-1):
    if iN % i == 0:
        iMax = len(str(max(i,iN//i)))
        if iMinMax < iMax :
            print(iMinMax)
            exit()
        else:
            iMinMax = iMax
print(iMinMax)

Submission status: Accepted

Solution code:
iN = int(input())
iLim = int(iN**0.5) + 1

iMinMax = len(str(iN))
for i in range(iLim+1,0,-1):
    if iN % i == 0:
        iMax = max(i,iN//i)
        iMinMax = min(len(str(iMax)),iMinMax)
print(iMinMax)

Submission status: Accepted

Solution code:
import math
a = int(input())
b = math.sqrt(a)   
count = 10 ** 8
for i in range(1,round(b)+1):
    if a % i == 0:
        j = a // i
        if len(str(i)) >= len(str(j)):
            if count > len(str(i)):
                count = len(str(i))
        else:
            if count > len(str(j)):
                count = len(str(j))
print(count)

Submission status: Accepted

Solution code:
def solve(N):
    ret = []
    for i in range(1, int(N ** 0.5) + 1):
        if N % i == 0:
            ret.append(max(len(str(i)), len(str(N // i))))
    return min(ret)


if __name__ == "__main__":
    N = int(input())
    print(solve(N))

Submission status: Accepted

Solution code:
N = int(input())
def F(A, B):
    return max(len(A), len(B))
ans = 10
for i in range(1, int(N**(1/2))+1):
    if N % i == 0:
        ans = min(ans, F(str(i), str(int(N/i))))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

maxN = int(N**(1/2))
for i in range(1,maxN+1):
    if N % i == 0:
        m1 = i

m2 = N//m1
m1 = str(m1)
m2 = str(m2)
print(max(len(str(m1)),len(str(m2))))

Submission status: Accepted

Solution code:
N = int(input())


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


ans = countDigits(N)
A = 1
while A * A <= N:
    if(N % A != 0):
        A += 1
        continue
    B = N // A

    cur = max(countDigits(A), countDigits(B))
    if (ans > cur):
        ans = cur
    A += 1
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
a=[]
r=int(math.sqrt(n))
for i in range(1,r+1):
    if n%i==0:
        a.append(len(str(int(n/i))))
a.sort()
print(a[0])

Submission status: Accepted

Solution code:
n = int(raw_input())
ans, i = n, 1
while i * i <= n:
    if n % i == 0:
        ans = min(ans, n / i)
    i += 1
print len(str(ans))

Submission status: Accepted

Solution code:
import math

N = int(input())
L = []
LL = []

if N == 1:
	L.append(1)
elif N == 2:
	L.append(1, 2)
else:
	n = int(math.sqrt(N) // 1)
	x = 1
	for i in range(n + 2):
		if N % x == 0:
			L.append(x)
		x += 1

for i in L:
	LL.append(int(N // i))

LLL = []

for i in range(len(L)):
	LLL.append(max(len(str(L[i])), len(str(LL[i]))))

print(min(LLL))

Submission status: Accepted

Solution code:
import math

N = int(input())
M = int(math.sqrt(N))

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

Submission status: Accepted

Solution code:
n = int(input())
a = int(n ** 0.5)
while a>0:
  if n%a == 0:
    print(len(str(n//a)))
    break
  a -= 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def getN():
    return int(input())


def getNM():
    return map(int, input().split())


def getList():
    return list(map(int, input().split()))

n = getN()
yakusuu = []
for i in range(1,int(math.sqrt(n)) + 1):
    if n % i == 0:
        yakusuu.append(i)

a = yakusuu[-1]
b = n//a
#print(a,b)
ans = max(len(str(a)), len(str(b)))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())


def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        i = 1
        while i*i <= num:
            if num%i == 0:
                divisor_list.append(i)
#                divisor_list.append(num//i)

            i += 1
#        divisor_list.append(num)

        return sorted(set(divisor_list))

li = make_divisor_list(N)

A = li[-1]
B = len(str(N // A))
A = len(str(A))

print(max(A,B))

Submission status: Accepted

Solution code:
def dig(x):
    cnt = 0
    while x > 0:
        cnt += 1
        x //= 10
    return cnt

N = int(input())
ans = 999
for i in range(1, 100001):
    if i > N:
        break
    di = dig(i)
    if N % i == 0:
        j = N // i
        ans = min(ans, max(di, dig(j)))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
def f(a,b):
    a = max(a,b)
    return len(str(a))
ans = float("inf")
for a in range(1, 100001):
    b, m = divmod(N, a)
    if m==0:
        ans = min(ans, f(a,b))
print(ans)

Submission status: Accepted

Solution code:
m = int(input())

import math


s = []
for i in range(math.floor(math.sqrt(m))+3):
	if m%(i+1)==0:
		if (i+1) not in s:
			s.append(i+1)
		if m//(i+1) not in s:
			s.append(m//(i+1))
s.sort()

n = math.floor(math.log10(m))
a = 0
b = 0

for i in range(len(s)):
	a = math.floor(math.log10(s[i]))
	b = math.floor(math.log10(m//s[i]))
	n= min(n,max(a,b))


print(n+1)

Submission status: Accepted

Solution code:
n=int(input())
st=int(n**0.5)
for i in range(st,0,-1):
  if n%i==0:
    break
j=n//i
ans=0
while i>0 or j>0:
  i//=10
  j//=10
  ans+=1
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
def divisor(n): #約数
    f=[]
    d=[1]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    for i in range(len(f)):
        t=[]
        for j in range(1,f[i][1]+1):
            t.append(f[i][0]**j)
        for j in range(len(d)):
            for k in range(len(t)):
                d.append(d[j]*t[k])
    return sorted(d)
x=divisor(n)
a=x[len(x)//2]
c=0
while a>=10:
    a=a/10
    c+=1
print(c+1)

Submission status: Accepted

Solution code:
import math
def dig(i):
    dig = 0
    while i > 0:
        i //= 10
        dig += 1
    return dig

N = int(input())
lim = int(math.sqrt(N))
ans = 11
for i in range(1, lim+1):
    if N % i == 0:
        ans = min(ans, dig(N//i))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = len(str(n))
import numpy

for i in range(2, int(numpy.sqrt(n))+1):
    if n % i == 0:
        ABmax = max(len(str(i)), len(str(n//i)))
        ans = min (ans, ABmax)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = len(str(n))
for a in range(1, int(n ** .5) + 1):
    if n % a == 0:
        b = n // a
        f = max(len(str(a)), len(str(b)))
        ans = min(ans, f)
print(ans)

Submission status: Accepted

Solution code:

import numpy as np

N = int(raw_input())
n=int(np.sqrt(N))
min_f=11
for i in range(n):
    if N%(i+1)==0:
        min_f = int(np.log10(N/(i+1)))+1

print min_f

Submission status: Accepted

Solution code:
N = int(input())
import math
sq = math.sqrt(N)

count = 0
min_num = N
while count <= sq:
    count += 1
    if N % count == 0:
        A = count
        B = N / count
        num = len(str(int(max(A, B))))
        if min_num > num:
            min_num = num
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
k = 1
for i in range(1,int(math.sqrt(n))+1):
    if n% i == 0:
        k = i
j = n // k

print(max(int(math.log10(j) + 1),int(math.log10(k) + 1)))

Submission status: Accepted

Solution code:
N=int(input())
l=[]
for i in range(1,int(N**(1/2))+1):
  if N%i==0:
    l1=max(len(str(i)),len(str(int(N/i))))
    l.append(l1)
  else:
    continue
    
print(min(l))

Submission status: Accepted

Solution code:
import math
n = int(input())
mindigit = len(str(n))
for i in range(int(math.sqrt(n))):
    q, mod = divmod(n, i+1)
    if mod == 0:
        tmp = max(len(str(i+1)), len(str(q)))
        if mindigit > tmp:
            mindigit = tmp
print(mindigit)

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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

    s = int(sqrt(N))
    ans = INF
    for a in range(1, s + 1):
        b = N // a
        if a * b == N:
            ans = min(ans, max(len(str(a)), len(str(b))))
    print(ans)

    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def F(a, b):
    return max([len(str(a)), len(str(b))])
N = int(input())
import math
i = int(math.sqrt(N))
while True:
    if N % i == 0:
        print(F(i, N // i))
        break
    i -= 1

Submission status: Accepted

Solution code:
N = int(input())

a = 1
ans = len(str(N))

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

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

Submission status: Accepted

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

i = 1
ans = 1000
while i <= sqrt(N):
  if N%i == 0:
    ans = min(ans, max(len(str(i)), len(str(N//i))))
  i += 1
  
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
def function(a,b):
    return max(len(str(a)), len(str(b)))
mini=len(str(N))
lim=len(str(int(N**(0.5))))
for i in range(2,int(N**(0.5)+1)):
    if mini==lim:
        break
    if N%i==0:
        if mini>function(i,N//i):
            mini=function(i,N//i)
print(mini)

Submission status: Accepted

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

n = int(input())
ans = 10**11
for i in range(1, int(n**(1/2))+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())
rn = int(n**0.5)+1
ans = 11
for i in range(1,rn+1):
    if n%i == 0:
        a = len(str(i))
        b = len(str(n//i))
        c = max([a,b])
        if c < ans:
            ans = c
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
answer = []
b = 0
for i in range(1,round(math.sqrt(N))+1):
  if N%i == 0:
    b = N//i
    answer.append(max(len(str(i)), len(str(b))))
print(min(answer))

Submission status: Accepted

Solution code:
import math

N = int(input())
answer = []
b = 0
for a in range(1,round(math.sqrt(N))+1):
  if N%a == 0:
    b = N//a
    answer.append(max(len(str(a)), len(str(b))))
print(min(answer))

Submission status: Accepted

Solution code:
import sys
n = int(input())
a = int(n**(1/2))
for i in range(a):
    if n%(a-i)==0:
        print(len(str(n//(a-i))))
        sys.exit()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if i > N/i:
                break
            if num % i == 0:
                divisor_list.append(i)

        return divisor_list

A = make_divisor_list(N)

B = []
ans = float("inf")

for a in A:
    b = int(N/a)
    c = max(a,b)
    ans = min(ans,len(str(c)))

print(ans)

Submission status: Accepted

Solution code:
import math

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

n = int(input())

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

Submission status: Accepted

Solution code:
import math
N = int(input())
M = math.ceil(math.sqrt(N))
#print(N, M)
for i in range(M):
    if N % (M - i) == 0:
        P = int(N / (M - i))
        Q = M - i
        break
#print(P, Q)
R = max(P, Q)
#print(R)
for i in range(10):
    R = R / 10
    if R < 1:
        print(i + 1)
        break

Submission status: Accepted

Solution code:
import math
n = int(input())
res = float('inf')
for i in range(1,int(n**.5)+1):
    if n%i==0:
        res = min(res,math.ceil(math.log10((n+1)/i)))
print(res)

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

def inpl(): return list(map(int, input().split()))
def inpl_s(): return list(input().split())

N = int(input())
A = int(math.sqrt(N))

while True:
	if N%A == 0:
		B = N//A
		print(max(len(str(A)),len(str(B))))
		break
	A -= 1

Submission status: Accepted

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

def f(i, j):
    if len(list(str(i))) <= len(list(str(j))):
        return len(list(str(j)))
    else:
        return len(list(str(i)))


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

    min_degit = float('inf')
    for i in range(1, int(n ** 0.5)+1):
        if n % i == 0:
            degit = f(n // i, i)
            if min_degit > degit:
                min_degit = degit
    print(min_degit)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

center = int(n**(1/2))

for i in range(center+1):
    if n % (center - i) == 0:
        print(len(str(n // (center - i))))
        exit()

Submission status: Accepted

Solution code:
n = int(input())

a = 1

def digitlen(i):
	t = i
	ret = 0	
	while t > 0 :
		t /= 10
		ret += 1
	return ret


ans = float("inf")

while a**2 <= n:
	if n%a == 0:
		b = n/a
		ans = min(ans, max(digitlen(a),digitlen(b)))

	a += 1

print ans

Submission status: Accepted

Solution code:
n = int(input())
rec = []
for i in range(1, 100005):
    if n % i == 0:
        rec.append((i, n // i))

num = float("inf")
for p, q in rec:
    rec = max(len(str(p)), len(str(q)))
    num = min(num, rec)

print(num)

Submission status: Accepted

Solution code:
import math
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])

cnt=1

mindata=10**10    
while cnt<=int(math.sqrt(n)):
    
    if n % cnt==0:
    
        mindata=min(mindata,max(len(str(cnt)),len(str(n//cnt))))
    
    cnt+=1
    
print(mindata)

Submission status: Accepted

Solution code:
from math import sqrt as q
f=lambda x,y:max(len(str(x)),len(str(y)))
a=int(input())
l=[f(int(a/i),i) for i in range(2,int(q(a))+2) if not a%i]
if l:
  print(min(l))
else:
  print(len(str(a)))

Submission status: Accepted

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

for i in range(1, int(sqrt(n))+1):
    if n%i == 0:
        a = i
        b = n//i
print(max(len(str(a)), len(str(b))))

Submission status: Accepted

Solution code:
n = int(input())

cent = int(n**(1/2))

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())


def F(a, b):
    a = int(math.log10(a)) + 1
    b = int(math.log10(b)) + 1
    return max(a, b)


ans = float('inf')
for i in range(1, int(math.sqrt(N)) + 1):
    if N % i != 0:
        continue
    a, b = i, N // i
    ans = min(ans, F(a, b))
print(ans)

Submission status: Accepted

Solution code:
def cnt_digits(x):
    if (x // 10) >0:
        return 1 + cnt_digits(x // 10)
    else:
        return 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(input())

aN = []
i = 1
# かけ合わせる数の左右逆はやる意味ない
while i <= N//i:
    if N % i == 0:
        aN.append([i, N//i])
    i += 1

# 末尾に格納されたペアの右側の数値
print(len(str(aN[-1][1])))

Submission status: Accepted

Solution code:
n = int(input())
j = n
p = []
for i in range(1, int(n**0.5)+1):
  if n%i==0:
    p.append((i, n//i))
a, b = p[-1][0], p[-1][1]
print(max(len(str(a)), len(str(b))))

Submission status: Accepted

Solution code:
import math as m

def find_cd(n):
    n_cd = set()
    for i in range(1,round(m.sqrt(n))+1):
        if n%i == 0:
            n_cd.add(i)
            n_cd.add(n//i)
            
    return list(n_cd)


def f(a,b):
    ans_a = 0
    ans_b = 0
    res_a = a
    res_b = b
    while res_a > 0:
        res_a = res_a // 10
        ans_a += 1
        
    while res_b > 0:
        res_b = res_b // 10
        ans_b += 1
        
    return max(ans_a, ans_b)
        
n = int(input())
lst = find_cd(n)

lst.sort()

len_lst = len(lst)

ans_min = 10000

for i in range(len_lst//2):
    ans = f(lst[i],lst[len_lst-i-1])
    ans_min = min(ans_min, ans)
    
if len_lst%2 == 1:
    ans = f(lst[len_lst//2], lst[len_lst//2])
    ans_min = min(ans_min, ans)

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

a = 1
i = 2
while i * i <= n:
    if n % i == 0:
        a = i
    i += 1

b = n // a
print(len(str(b)))

Submission status: Accepted

Solution code:
import math

n=int(input())

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

for i in range(l+1, 0, -1):
    if n%i==0:
        a = n//i
        b = i
        if a<b:
            ans = b
        else:
            ans = a
        c = 0
        while ans>0:
            ans = ans//10
            c += 1
        print(c)
        break

Submission status: Accepted

Solution code:
from math import sqrt, floor, log
from sys import exit
n = int(input())

for i in range(floor(sqrt(n)), 0, -1):
    if n % i == 0:
        print(1+floor(log(n//i,10)))
        exit(0)

Submission status: Accepted

Solution code:
import math, sys

N = int(input())

sqrt_n = round(math.sqrt(N))
# print(sqrt_n)

min_f = sys.maxsize
for i in range(sqrt_n, 0, -1):
    if N % i == 0:
        len_A = len(str(i))
        len_B = len(str(N//i))
        F = max(len_A, len_B)
        min_f = min(min_f, F)

print(min_f)

Submission status: Accepted

Solution code:
N = int(input())

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

ans = len(str(N))

a = 1
while a*a <= N:
    if N % a == 0:
        b = N // a
        cur =F(a, b)
        if ans > cur:
            ans = cur
    a += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

min_f = float('inf')
for i in range(1, int(math.sqrt(N) + 1)):
    if N % i == 0:
        A = str(int(i))
        B = str(int(N // i))
        F = max(len(A), len(B))
        min_f = min(min_f, F)
print(min_f)

Submission status: Accepted

Solution code:
import math

N = int(input())

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

for i in range(1, int(math.sqrt(N)) + 1) :
    if N % i == 0 :
        max_len = f(i, N // i)
        
print(max_len)

Submission status: Accepted

Solution code:
import math

# input
N = int(input())

i = int(math.sqrt(N))

while i:
    if N % i == 0:
        print(len(str(N // i)))
        break
    else:
        i -= 1

Submission status: Accepted

Solution code:
import math

# input
N = int(input())

i = int(math.sqrt(N))

while i > 0:
    if N % i == 0:
        print(len(str(N // i)))
        break
    else:
        i -= 1

Submission status: Accepted

Solution code:
N=int(input())
import math
sqN=math.sqrt(N)
sqN=math.ceil(sqN)
i=1
ans=float('inf')
def digits(n):
    return(math.floor(math.log10(n))+1)
while i <= sqN:
    q,r=divmod(N,i)
    if r==0:
        ans=min(ans,max(digits(i),digits(q)))
    i+=1
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())
min_f = 10
for n in range(1, int(math.sqrt(N)) + 1):
    a = n
    if N % n != 0:
        continue
    b = int(N / n)
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input().strip())
# 約数の列挙
def list_divisor(N):
    lw=1
    up=N
    divsl=[lw]
    divsu=[up]
    while lw<up:
        lw+=1
        up=N//lw
        if N%lw==0:
            if lw<up:
                divsl.append(lw)
                divsu.append(up)
            elif lw==up:
                divsl.append(lw)
    return divsl+divsu[::-1]
lst=list_divisor(N)
mn=float('inf')
for a in lst:
    b=N//a
    ans=max(len(str(a)),len(str(b)))
    if mn > ans:
        mn=ans
    if b<=a:
        break
print(mn)

Submission status: Accepted

Solution code:
N = int(input())

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

if N == 1:
    print("1")
else:
    print(len(str(ans[-1])))

Submission status: Accepted

Solution code:
from functools import reduce
n=int(input())
def sqdivlist(n):
    lista=[]
    for i in range(1,int((n**0.5)//1)+1):
        if n%i==0:
            lista.append(str(i))
    return (lista)
t=len(sqdivlist(n))
u=(sqdivlist(n))
lista2=[]
ans=[]
for j in range(t):
    lista2.append(int(n/int(u[j])))
    ans.append(max(len(str(u[j])),(len(str(lista2[j])))))
print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
f=[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        f.append(i)
        f.append(int(n/i))
if n==1:
    print('1')
else:
    print(len(str(f[-1])))

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = 100

# 桁数を計算する関数
def cal_digits(n):
    digits = 0
    while True:
        if n // 10 < 1:
            digits += 1
            break
        n //= 10
        digits += 1
    return digits

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

print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = 100
def cal_string(n1, n2):
    return max(len(str(n1)), len(str(n2)))

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

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
m = int(math.sqrt(n)+1)

ans = int(999999999999999)
for i in range(1, m) :
    if n%i!=0 :
        continue
    
    j = int(n/i)
    ans = min(ans, max(len(str(j)), len(str(i))))

print(ans)

Submission status: Accepted

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

def is_integer(number):
    return number == int(number)

A=1
answer=11
while A <= math.sqrt(N):
    if is_integer(N/A):
        n_a=1
        while A>=pow(10, n_a):
            n_a+=1
        B=int(N/A)
        n_b=1
        while B>=pow(10, n_b):
            n_b+=1
        if max(n_a, n_b)<answer:
            answer = max(n_a, n_b)
    else:
        pass
    A+=1
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
n = int(math.sqrt(N))
while N%n!=0:
  n = n-1
k = N/n
l = math.log(k,10)
print(int(l)+1)

Submission status: Accepted

Solution code:
def m():
    n = int(input())
    i=1
    div = []
    while i*i <= n:
        if n % i == 0:
            div.append(i)
        i+=1
    a = max(div)
    b = n // a
    d = max(a,b)
    return len(str(d))

print(m())

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
F = 10
for i in range(1,int(sqrt(N))+1):
    if N%i == 0:
        A = max([len(str(i)),len(str(N//i))])
        if A < F: F = A
            
print(F)

Submission status: Accepted

Solution code:
F=lambda*m:max(len(str(x))for x in m)
N=int(input())
print(min(F(x,N//x)for x in range(1,int(N**.5)+1)if N%x==0))