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: Runtime Error

Solution code:
import math

N = int(input())

anss = []
for n in range(1,math.ceil(N**0.5)):
	if N % n == 0:
		anss.append(max(len(str(n)),len(str(N//n))))
		
print(min(anss))

Submission status: Runtime Error

Solution code:
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table
prime_lst=prime_decomposition(int(input()))
A=prime_lst[:-1]
B=int(prime_lst[-1])
_A=1
for a in A:
    _A*=a
print(len(str(_A)) if len(str(_A)) > len(str(B)) else len(str(B)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
rootn = int(N**0.5) +1
A = range(1, rootn)
min_digits = 11
for i in A:
    if (N % A) == 0:
        B = N // A
        p, q =len(str(A)), len(str(B))
        if (p > q) and p < min_digits:
            min_digits = p
        elif (p <= q) and q < min_digits:
            min_digits = q
print(min_digits)

Submission status: Runtime Error

Solution code:
N = int(input())
rootn = int(N*0.5) +1
A = range(1, rootn)
min_digits = 11
for i in A:
    if (N % A) == 0:
        B = N // A
        p, q =len(str(A)), len(str(B))
        if (p > q) and p < min_digits:
            min_digits = p
        elif (p <= q) and q < min_digits:
            min_digits = q
print(min_digits)

Submission status: Runtime Error

Solution code:
def f(a, b):
    al = len(str(a))
    bl = len(str(b))
    if al > bl:
        return al
    return bl
N = int(input())
n = int(N**0.5)
result = 12
for i in range(1, n+1):
    for j in range(1, n+1):
        if i*j == N:
            r = f(i, j)
            if r < result:
                result = r
print result()

Submission status: Runtime Error

Solution code:
n=int(input())
ans = len(str(n))
l = [ i for i in range(1,n+1) if i*i < n]
for a in l:
    if n % a == 0 and ans > max(len(str(a)),len(str(int(n / a))))
        ans = max(len(str(a)),len(str(int(n / a))))
print(ans)

Submission status: Runtime Error

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 and ans > max(len(str(a)),len(str(int(n / a))))
        ans = max(len(str(a)),len(str(int(n / a))))
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

def prime_factor(n):
    i = 2
    table = [1]
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

res = prime_factor(N)

tmp = 1
tmp2 = N
for i in range(len(res)):
    if len(str(tmp)) >= len(str(tmp2)):
        break
    count = tmp2
    tmp2 = tmp2//res[i]
    tmp *= res[i]
    
print(len(str(count)))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
def f(n):
  g = float('inf')
  for i in [j for j in range(1,math.ceil(n**0.5))+1 if n%j == 0]:
    if g > len(str(max(i,n//i))):
      g = len(str(max(i,n//i)))
    if g == float('inf'):
        g = 1
  return g
print(f(n))

Submission status: Runtime Error

Solution code:
N = int(input())

m = int(N **0.5)
for i in range(1,m):
    j = N // i
    if i*j < N:
        continue
    k = i
a = N // k
ans=0
b = str(a)
ans = len(b)

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

m = int(N **0.5)
for i in range(1,m):
    j = N / i
    if int(j) < j:
        continue
    k = i
a = N // k
ans=0
while a >= 1:
    a //=10
    ans+=1

print(ans)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A = []
B = []
F = []

for i in range(1,int(math.sqrt(N)),1):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A = []
B = []
F = []
for i in range(1,int(N/2),1):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A = []
B = []
F = []
for i in range(1,N/2):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A = []
B = []
F = []
for i in range(1,N):
    if (N%i)== 0:
        A.append(N/i)
        B.append(i)
for i in range(len(A)):
    count_A = int(math.log10(A[i])+1)
    count_B = int(math.log10(B[i])+1)
    if count_A >= count_B:
        F.append(count_A)
    else:
        F.append(count_B)
print(min(F))

Submission status: Runtime Error

Solution code:
from math import sqrt, floor
from functools import reduce


def factorization(N):
    s = floor(sqrt(N))
    result = []
    for i in range(2, s + 1):
        if N % i == 0:
            r = 0
            while(N % i == 0):
                N //= i
                r += 1
            result += [i] * r
    if result == []:
        result = [1, N]
    return result


N = int(input())
p = factorization(N)
a = int(reduce(lambda x, y: x * y, p[0::2]))
b = int(reduce(lambda x, y: x * y, p[1::2]))

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

Submission status: Runtime Error

Solution code:
from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

C = res(0, [], [])
print(min(C))

Submission status: Runtime Error

Solution code:
N = int(input())

def factorize(n):
    # NOTE: if n == 1, return []
    if n < 1:
        raise Exception('Invalid input: n = {}'.format(n))
    i = 2
    ret = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            ret.append(i)
        i += 1
    if n > 1:
        ret.append(n)
    return ret

A = factorize(N)
l = len(A)

def res(i, B, C):
    if i >= l:
        val = 1
        for b in B:
            val *= b
        C.append(max(len(str(val)), len(str(N//val))))
        return None
    B.append(A[i])
    res(i+1, B, C)
    B.pop()
    res(i+1, B, C)
    return C

C = res(0, [], [])
print(min(C))

Submission status: Runtime Error

Solution code:
b = input()
a =int(b)
m = len(b)
for i in reversed(range(1,int(math.sqrt(a))+1)):
    if a/i == int(a/i):
        m = max(len(str(a//i)),len(str(i)))
        break
print(m)

Submission status: Runtime Error

Solution code:
import math


def divisor(num):
    if num < 0:
        return 0
    elif num == 1:
        return 1
    else:
        divisor_list = [1, ]
        for i in range(2, int(math.sqrt(num) + 1)):
            if num % i == 0:
                divisor_list.append(i)
        return divisor_list


n = int(input())

divisor_list = divisor(n)
minA = divisor_list[-1]
print(len(str(n//minA)))

Submission status: Runtime Error

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

li_res = list()

for a in range(1, int(math.sqrt(int_n))):
   if int_n % a == 0:
        b = int_n // a
        li_res.append(max([len(str(a)), len(str(b))]))

print(min(li_res))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
m = int(math.sqrt(N))
a = 0
ans = 0
count = 1

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

a = max(a, (N//a))

while True:
    if a >= 10:
        count += 1
        a = a// 10
    else:
        break
    
print(count)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

array = []
r = 2
result = 11

while True:
    while True:
        if N % r == 0:
            array.append(r)
            N //= r
        else:
            break
    if N == 1:
        break

    r += 1

for i in range(2 ** len(array)):
    bin_i = bin(i)[2:]
    bin_i = '0' * (len(array) - len(bin_i)) + bin_i
    A = 1
    B = 1
    for j in range(len(bin_i)):
        if bin_i[j] == '1':
            A *= array[j]
        else:
            B *= array[j]

    result = min(result, max(len(str(A)), len(str(B))))

print(result)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N=int(input())
if N==1:
	print(1)
else:
	nmax = math.ceil(math.sqrt(N))
	Bdigimin = 10
	for i in range(nmax):
		if N % (i+1) == 0:
			Bdigi = math.floor(math.log10(N/i))
			if Bdigimin > Bdigi:
				Bdigimin = Bdigi
	print(int(Bdigimin+1))

Submission status: Runtime Error

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

insu = {}

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

dct = sorted(insu.items())

for i in range(len(dct) // 2 + 1):
    if len(dct) - i * 2 <= 1:
        ans1 = dct[i][0]
        ans2 = dct[len(dct) - i][0]
        for i in range(1, 10):
            if ans2 // 10 == 0:
                print(i)
                break
            ans2 //= 10
        sys.exit(0)

Submission status: Runtime Error

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))):
    if N % a == 0:
        b = N // a
        ans.append(max(digits(a), digits(b)))

print(min(ans))

Submission status: Runtime Error

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))])
    
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: Runtime Error

Solution code:
N = int(input())

divList = []

n = N

while n != 1:
    if n % 2 == 0:
        n = n // 2
        divList.append(2)
        continue
    if n % 3 == 0:
        n = n // 3
        divList.append(3)
        continue

    newN = n
    isFind = False
    for i in range(6, (n**(1/2)) + 1, 6):
        if n % (i - 1) == 0:
            divList.append(i - 1)
            newN = newN // (i - 1)
            isFind = True
        if n % (i + 1) == 0:
            divList.append(i + 1)
            newN = newN // (i + 1)
            isFind = True

        if isFind == True:
            break

    if isFind == False:
        divList.append(n)
        newN = 1
    n = newN

    # print(divList)

# print(divList)

t = [([1], [1])]

for d in divList:
    newT = []
    for ab in t:
        a, b = ab[0], ab[1]
        a_add = a[:]
        a_add.append(d)
        b_add = b[:]
        b_add.append(d)

        newT.append((a, b_add))
        newT.append((a_add, b))
    t = newT

# print(t)

from functools import reduce

a1 = [(reduce(lambda a, b:a * b, ab[0]), reduce(lambda a, b:a * b, ab[1]))
      for ab in t]
# print(a1)


a2 = set([(len(str(ab[0])), len(str(ab[1]))) for ab in a1])

# print(a2)

a3 = [max(ab[0], ab[1]) for ab in a2]

# print(a3)

print(min(a3))

Submission status: Runtime Error

Solution code:
var
 n,i,x:int64;
 y:string;
begin
 readln(n);
 i:=1;
 while i<=trunc(sqrt(n)) do
  begin
   if n mod i=0 then x:=n div i;
   inc(i);
  end;
 str(x,y);
 writeln(length(y));
end.

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int( input())
ans = len(N)
for i in range(N//2,N):
    if N%i == 0:
        ans = min( ans, len(i))
        break
print(ans)

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
answer = 1000
b = 0
for a in range(round(abs(N))):
  if N&a == 0:
    b = N/a
    if answer < min(len(str(a)), len(str(b))):
      answer = min(len(str(a)), len(str(b)))
print(answer)

Submission status: Runtime Error

Solution code:
N = int(input())
answer = 1000
for a in range(round(abs(N))):
  if N&a == 0:
    b = N/a
    if answer < min(len(str(a)), len(str(b))):
      answer = min(len(str(a)), len(str(b)))
print(answer)

Submission status: Runtime Error

Solution code:
import math

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())

ans = []
for i in range(1, round(math.sqrt(N))):
    if N % i == 0:
        tmp = max(len(str(i)), len(str(N//i)))
        ans.append(tmp)

print(min(ans))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import sqrt, ceil, floor, log10

N = int(input())

min_f = ceil(log10(N))
for A in range(1, ceil(sqrt(N))):
    if N % A != 0:
        continue
    else:
        B = N // A
        f = floor(max(log10(A), log10(B))) + 1
        if f < min_f:
            min_f = f

print(f)

Submission status: Runtime Error

Solution code:
from math import sqrt, ceil, floor, log10, inf

N = int(input())

min_f = inf
for A in range(1, ceil(sqrt(N))):
    if N % A != 0:
        continue
    else:
        B = N // A
        f = floor(max(log10(A), log10(B))) + 1
        if f < min_f:
            min_f = f

print(f)

Submission status: Runtime Error

Solution code:
n = int(input())
import math as ms
dic = []
for i in range(1,ms.floor(n / 2) + 1):
    if n % i == 0:
        dic.append([i,n // i])
    
f = []
for i in range(len(dic)):
    a = ms.floor(ms.log10(dic[i][0])) + 1
    b = ms.floor(ms.log10(dic[i][1])) + 1
    f.append(max(a,b))
    
print(min(f))

Submission status: Runtime Error

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

i=1
ans=13
j=0

while i<sqrt(n):
    if n%i==0:
        j=n/i
        ans=int(min(ans,max(log10(i)+1,log10(j)+1)))
    i+=1
if j==0:
    ans=int(max(log10(i)+1,log10(j)+1))
print(ans)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
from math import sqrt,ceil,log10

n = int(input())

nsr = sqrt(n)

x = -1
for i in range(1,ceil(nsr)):
    if n%i==0:
        x = n//i

ret = ceil(log10(x))
if 10**(ret)==int(x):
    print(ret+1)
else:
    print(ret)

Submission status: Runtime Error

Solution code:
import itertools
n = int(input())
n2 = n

i = 2
table = []
while i * i <= n:
    while n % i == 0:
        n //= i
        table.append(i)
    i += 1
if n > 1:
    table.append(n)

temp = []
for i in range(len(table)):
    temp += list(itertools.permutations(table, i))
ans = []
for i in temp:
    s = 1
    for j in i:
        s *= j
    a, b = s, n2//s
    ans.append(max(len(str(a)), len(str(b))))
print(min(ans))

Submission status: Runtime Error

Solution code:
n = int(input())
dv = []
dved = []
for i in range(1,n):
    if n%i==0 and not(i in dved):
        dv.append(i)
        dved.append(n//i) 
    if i in dved:
        break
print(len(str(dved[-1])))

Submission status: Runtime Error

Solution code:
n=int(input())
import math
ans=[]
ans_i=[]
for i in range(1,int(math.sqrt(n))):
    if n%i==0:
        ans.append(i)
        ans_i.append(n//i)
v=list(str(max(max(ans,ans_i))))
print(len(v))

Submission status: Runtime Error

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

def order(a,b):
    return max(len(str(int(a))),len(str(int(b))))
    
ans = [] 


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

print(min(ans))

Submission status: Runtime Error

Solution code:
n = int(input())

def order(a,b):
    return max(len(str(int(a))),len(str(int(b))))
    
ans = [] 
numbers = []

for i in range(1,n):
    if len(numbers) != 0:
        if i > min(numbers):
            break
    if n % i == 0:
        ans.append(order(n/i,i))
        numbers.append(n/i)
        

print(min(ans))

Submission status: Runtime Error

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

max_v = int(sqrt(N))
for num in range(max_v,1,(-1)):
	if N % num == 0:
		div = num
		break

print(max(len(str(div)),len(str(N//max_v))))

Submission status: Runtime Error

Solution code:
import math

N = int(input())

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

elements = []

for i in range(1, math.floor(math.sqrt(N+1))):
    if N % i == 0: elements.append(i)

a = elements[-1]
b = N // a
print(F(a,b))

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>


using namespace std;


long long f(long long a, long long b)
{
  string x=to_string(a), y=to_string(b);
  return max(x.length(), y.length());
}


int main()
{
  long long n, i, minv=100000000000;

  cin >> n;
  i = 1;
  while (i <= (long long)sqrt((long long)n)){
    if (n%i == 0 && f(i, n/i) < minv) minv = f(i, n/i);
    i++;
  }
  cout << minv << endl;
  
  return 0;
}

Submission status: Runtime Error

Solution code:
# Digits in Multiplication
N = int(input())

if num < 1:
    l = []
elif num == 1:
    l = [1]
else:
    l = []
    l.append(1)
    [l.append(i) for i in range(2, num // 2 + 1) if num % i == 0]
    l.append(num)
l = list(map(str,l))
L = len(l)
r = [max(len(l[i]), len(l[L-i-1])) for i in range(int((L+1)//2))]
print(min(r))

Submission status: Runtime Error

Solution code:
# Digits in Multiplication
N = int(input())

import sympy as sm
l = list(map(str, sm.divisors(N)))
L = len(l)
r = [max(len(l[i]), len(l[L-i-1])) for i in range(int((L+1)//2))]
print(min(r))

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-
import math
N = int(input())
a = list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))
a.sort()
print(min(a))

Submission status: Runtime Error

Solution code:
# -*- coding:utf-8 -*-
import math
N = int(input())
print(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))).pop(0))

Submission status: Runtime Error

Solution code:
while True:
    N = int(input())
    Y = list()
    Z = list()
    A = list()
    Yd = list()
    Zd = list()

    for i in range(1,N+1):
        if N % i == 0:
            Y.append(i)
            Yd.append(len(str(i)))
            Z.insert(0,i)
            Zd.insert(0,len(str(i)))

    L = int(len(Y))
    for i in range(L):
        var = int(Yd[i]) * int(Zd[i])
        A.append(var)

    A.sort(reverse = True)
    print(A[0])

Submission status: Runtime Error

Solution code:
import math
f=lambda a,b:int(max(math.log10(a),math.log10(b))+1)
def g(n):
	for i in range(1,int(n**0.5)):
		if n%i==0:yield f(i,n//i)
print(min(g(int(input()))))

Submission status: Runtime Error

Solution code:
import math
a = int(input())
for i in range(1 , math.floor(math.sqrt(a))):
    if a % i == 0:
        ans = math.ceil(math.log10(a / i))
        
print(ans)

Submission status: Runtime Error

Solution code:
import math
a = long(input())
for i in range(1 , math.ceil(math.sqrt(a))):
    if a % i == 0:
        ans = math.ceil(math.log10(a / i))

print(ans)

Submission status: Runtime Error

Solution code:
import math
a = int(input())
for i in range(1 , math.ceil(math.sqrt(a))):
    if a % i == 0:
        ans = math.ceil(math.log10(a / i))
        
print(ans)

Submission status: Runtime Error

Solution code:
import math
a = int(input())
print(math.ceil(math.sqrt(a)))
for i in range(1 , math.ceil(math.sqrt(a))):
    if a % i == 0:
        ans = math.ceil(math.log10(a / i))
        
print(ans)

Submission status: Runtime Error

Solution code:
from math import sqrt

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = long(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N))) if N % r == 0]))
print(min(m)) if len(m) != 0 else print(len(str(N)))

Submission status: Runtime Error

Solution code:
def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count

stac=[]
N=int(input())
for i in range(1,int(N/2+1)):
    if N%i==0:
        j=int(N/i)
        stac.append(max(keta(i),keta(j)))

print(min(stac))

Submission status: Runtime Error

Solution code:

import math

n = int(raw_input())

i = 1
# sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = n / i
        #ans = int(math.log10(n / i)) + 1
    i += 1
print len(str(ans))#(ans)

Submission status: Runtime Error

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

import math

n = int(raw_input())

i = 1
# sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = n / i
        ans = int(math.log10(n / i)) + 1
    i += 1
print len(str(ans))#(ans)

Submission status: Runtime Error

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

import math

n = int(raw_input())

i = 1
sqn = math.ceil(math.sqrt(n))

while math.sqrt(n) > i:
    if n % i == 0:
        ans = int(math.log10(n / i)) + 1
    i += 1
print(ans)

Submission status: Runtime Error

Solution code:
import math

N = int(input())

def enum(N,A):
	if(N % A == 0):
		B = N // A
		return (A,B)
	else:
		return 'NULL'

def F(tupleX):
	t = max(tupleX)
	return int(math.log10(t) + 1)

X = []  # 候補
for n in range(1,N):
	X.append(enum(N,n))

Y = [] 
for x in X:
    if (x == 'NULL'):
        continue
    else:
	    y = F(x)
	    Y.append(y)
	
print(min(Y))

Submission status: Runtime Error

Solution code:
import math

N = int(input())

def solve(N,A):
	if(N % A == 0):
		B = N / A
		return int(math.log10(max(A,B)) + 1)
	else:
		return -1
		

ans = []
for A in range(1,N):
	ans.append(solve(N,A))
print(max(ans))

Submission status: Runtime Error

Solution code:
mport numpy as np
def F(x,y):
    count = 1
    if x<=y:
        while y >= 10:
            y = y/10
            count += 1
    if x>y:
        while x >= 10:
            x = x/10
            count += 1
    return count
#print F(1,13)
N = input()
min = 10**10
for i in range(np.sqrt(N).astype(np.int32)):
    if N%(i+1) == 0:
       if min > F(i+1,N/(i+1)):
           min = F(i+1,N/(i+1))
       print i+1

print min

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math

num_N = int(input())

min_num = math.inf
sqrt_N = math.floor(math.sqrt(num_N))

for i in range(1, sqrt_N + 1):
    if num_N % i == 0:
        len_num_A = len(str(i))
        len_num_B = len(str(int(num_N / i)))
        min_num = min(min_num, max(len_num_A, len_num_B))

print(min_num)

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math

num_N = int(input())

min_num = math.inf
sqrt_N = math.floor(math.sqrt(num_N))

for i in range(1, sqrt_N + 1):
    if num_N % i == 0:
        len_num_A = len(str(i))
        len_num_B = len(str(num_N // i))
        min_num = min(min_num, max(len_num_A, len_num_B))

print(min_num)

Submission status: Runtime Error

Solution code:
N = int(raw_input())

for i in xrange(1, N):

    if i*i == N:
        t = i
        break

    elif i*i > N:
        break

    if N % i == 0:
        t = i

print len(str(N/t))

Submission status: Runtime Error

Solution code:
N = int(raw_input())

for i in xrange(1, N):

    if i*i > N:
        break

    elif i*i == N:
        t = i
        break

    if N % i == 0:
        t = i

print len(str(N/t))

Submission status: Runtime Error

Solution code:
N = int(raw_input())

for i in xrange(1, N):

    if i*i > N:
        break

    if N % i == 0:
        ans = len(str(N/i))

print ans

Submission status: Runtime Error

Solution code:
# coding: utf-8
import math

num_N = int(input())

min_num = math.inf

for i in range(1, math.floor(math.sqrt(num_N)) + 1):
    if num_N % i == 0:
        num_A = i
        num_B = int(num_N // i)
        len_num_A = len(list(str(num_A)))
        len_num_B = len(list(str(num_B)))
        min_num = min(min_num, max(len_num_A, len_num_B))

print(min_num)

Submission status: Runtime Error

Solution code:
N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    
    if N%i == 0: #余りが0 = iは整数なので整数同士の割り算ということ(余りを求める際には少数まで商を求めない）
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)

Submission status: Runtime Error

Solution code:
N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    if N%i == 0: #余りが0 = iは整数なので整数同士の割り算ということ(余りを求める際には少数まで商を求めない）
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)

Submission status: Runtime Error

Solution code:
N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    print(i)
    
    if N%i == 0: #余りが0 = iは整数なので整数同士の割り算ということ(余りを求める際には少数まで商を求めない）
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)

Submission status: Runtime Error

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
	i += 1
print(score)

Submission status: Runtime Error

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
	"""
        if score == len(str(i)):
            break
        i = max(N // (10 ** (score - 1)), i+1)
    """
	i += 1
print(score)

Submission status: Runtime Error

Solution code:
N = int(raw_input())
t = 0
for i in xrange(1, N):

    if i*i > N:
        break

    elif i*i == N:
        t = i
        break

    if N % i == 0:
        t = i

print max(len(str(t)), len(str(N/t)))

Submission status: Runtime Error

Solution code:
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n //= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

N = int(input())
if N = 1:
    print(1)
else:
    table = prime_decomposition(N)
    digN = len(str(N))
    digMaxEle = len(str(table[-1]))
    if digN / 2  < digMaxEle:
        print(digMaxEle)
    else:
        print(digN//2 + digN%2)

Submission status: Runtime Error

Solution code:
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n //= i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

N = int(input())
table = prime_decomposition(N)
digN = len(str(N))
digMaxEle = len(str(table[-1]))
if digN / 2  < digMaxEle:
    print(digMaxEle)
else:
    print(digN//2 + digN%2)

Submission status: Runtime Error

Solution code:
import math

N = int(input())

for i in range(1, math.floor(math.sqrt(N))):
    if N % i == 0:
        factor = N / i

factor = int(factor)
print(len(str(factor)))