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

n = int(math.sqrt(N))+1
#print(n)
def digit(x):
    if 1 <= x < 10:
        return 1
    elif x < 100:
        return 2
    elif x < 1000:
        return 3
    elif x < 10000:
        return 4
    elif x < 100000:
        return 5
    elif x < 1000000:
        return 6
    elif x < 10000000:
        return 7
    elif x < 100000000:
        return 8
    elif x < 1000000000:
        return 9
    else:
        return 10

while True:
    if(N % n == 0):
        k = N / n
        print(digit(k))
        break
    n-=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
        l = max(len(str(a)), len(str(b)))
        ans = min(ans, l)
    a += 1

print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

n = math.floor(N **(1/2))
list =[]
count = 0
for a in range(1,n+1):
    if N % a  != 0:
        pass
    else:
        b = int(N/a)
        #print(a,b)
        m = max(len(str(a)),len(str(b)) )
        #list.append(m)
        count += 1
        if count == 1:
            mintmp = m

        if  mintmp > m:
            mintmp = m

#print(min(list))
print(mintmp)

Submission status: Accepted

Solution code:
import math

N = int(input())

n = math.floor(N **(1/2))
list =[]

for a in range(1,n+1):
    if N % a  != 0:
        pass
    else:
        b = int(N/a)
        #print(a,b)
        m = max( len(str(a)), len(str(b)) )
        list.append(m)

#print(list)
print(min(list))

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

Submission status: Accepted

Solution code:
import math
N=int(input())
sN=math.sqrt(N)
ans=10000
for i in range(1,int(sN)+1):
    if N%i==0:
        k1=N/i
        k=int(k1)
    
        if ans > len(str(k)):
            ans=len(str(k))

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 0
for a in range(1,N+1):
    if a**2 > N:
        break
    if N%a != 0:
        continue
    b = N//a
    ans = len(str(b))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = len(str(N)) # Fの値は高々この値
for A in range(1, int(N**0.5) + 1):
  if N % A != 0: # AはNの約数でない
    continue
  B = N // A
  f = len(str(max(A,B)))
  ans = min(ans, f)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

up = int(n**0.5) + 1
b = 0
for i in range(up, 0, -1):
    if n % i == 0:
        b = n // i
        break

f = 1
while b // 10 != 0:
    b //= 10
    f += 1

print(f)

Submission status: Accepted

Solution code:
from math import sqrt

n = int(input())
l = []
j = int(sqrt(n))

while True:
	if n % j == 0:
		break
	j -= 1

print(len(str(n // j)))

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = len(str(N))

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

print(ans)

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:
    if max(len(str(i)), len(str(n//i))) < ans:
      ans = max(len(str(i)), len(str(n//i)))

print(ans)

Submission status: Accepted

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

# AtCoder Beginner Contest
# Problem C


def count_digit(number: int):
    return len(str(number))


if __name__ == '__main__':
    from math import sqrt

    n = int(input())
    result = 11

    for i in range(1, int(sqrt(n)) + 1):
        if n % i == 0:
            candidate = max(count_digit(i), count_digit(n // i))
            result = min(result, candidate)

    print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt, ceil
n = int(input())
def solve(n):
    ans = len(str(n))
    for i in range(3, ceil(sqrt(n))+1):
        if n % i == 0:
            ans = min(ans, max(len(str(i)), len(str(n//i))))
    return ans
print(solve(n))

Submission status: Accepted

Solution code:
N=int(input())

def solve(a):
  ans=100
  cnt=1
  while cnt*cnt<=a:
    if a%cnt == 0:
      x=str(a//cnt)
      y=str(cnt)
      ans=min(ans,max(len(x),len(y)))
    cnt+=1
  return ans

print(solve(N))

Submission status: Accepted

Solution code:
n = int(input())
a,b=[],[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        a.append(i)
        b.append(int(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: Accepted

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

N = int(input())

min_f = floor(log10(N)) + 1
for A in range(1, ceil(sqrt(N)) + 1):
    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: Accepted

Solution code:
import math

N = int(raw_input())
rootN = int(math.sqrt(N))

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

Submission status: Accepted

Solution code:
N = int(input())
ans = len(str(N))
i = 1
while i*i <= N:
    if N%i :
        i += 1
    else:
        ans = min(ans, max(len(str(i)), len(str(N//i))))
        i += 1

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())
res = float("inf")
for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0 and res > max(len(str(int(n/i))), len(str(i))):
        res = max(len(str(int(n/i))), len(str(i)))

print(res)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())
import math as ms
dic = []
for i in range(1,ms.floor(ms.sqrt(n)) + 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: Accepted

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

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

n = int(input())

def cntd(x):
    digits = 0

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

ans = cntd(n)

a = 1
while a*a<=n:
    if n%a!=0:
        a += 1
        continue

    b = n//a
    cur = max(cntd(a), cntd(b))
    if ans>cur:
        ans = cur
    a += 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
ans = 10**10

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

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

print(ans)

Submission status: Accepted

Solution code:
from math import sqrt
n = int(input())
digit = 10
for a in range(int(sqrt(n)), 0, -1):
    b = n / a
    if b == int(b):
        if digit > len(str(int(b))):
            digit = len(str(int(b)))
print(digit)

Submission status: Accepted

Solution code:
n=int(input());x=int(n**.5)
while n%x:x-=1
print(len(str(n//x)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt
def calc_digit(n):
    res = 0
    while n != 0:
        res += 1
        n //= 10
    return res

n = int(input())
res = calc_digit(n)
for a in range(1, int(sqrt(n)) + 1):
    if n % a != 0:
        continue
    b = n // a
    f = max(calc_digit(a), calc_digit(b))
    res = min(res, f)
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
m = math.ceil(math.sqrt(n))*2

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

print(ans)

Submission status: Accepted

Solution code:
import math
import sys
n=int(input())
mi=int(math.log10(n))
nb=n
m=1
for i in range(1,int(nb**0.5)+2):
  if(n%i==0):
    mi=min(mi,max(int(math.log10(n/i)),int(math.log10(i))))
print(mi+1)

Submission status: Accepted

Solution code:
import sys
n=int(input())
if n<10:
    print(1)
    sys.exit()
ans=float("inf")
for i in range(1,int(n**(1/2))+1):
    if n%i==0:
        ans=min(ans,max(len(str(int(n//i))),len(str(i))))
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
dv = []
dved = []
for i in range(1,int(math.sqrt(n)+1)):
    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]))if len(dv)>0 else 1)

Submission status: Accepted

Solution code:
from math import floor, sqrt

def divisors(n):
    div = [1]
    for i in range(2, 1 + floor(sqrt(n))):
        if n % i == 0:
            div.append(i)
    return div

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


if __name__ == '__main__':
    n = int(input())
    minimum = len(str(n))
    for a in divisors(n):
        b = n // a
        minimum = min(minimum, f(a, b))
    print(minimum)

Submission status: Accepted

Solution code:
import math

n = int(input())
m = 0
for i in range(1, int(math.sqrt(n) + 1)):
    if n % i == 0:
        m = max(m, i)
m = n // m
c = 0
while m > 0:
    m //= 10
    c += 1
print(c)

Submission status: Accepted

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

Submission status: Accepted

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

b = n/a
ans = int(math.log10(b) + 1)
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

def get_divisor_list(N):
    divisor_list = []

    for i in range(1, int(math.sqrt(N)) + 1):
        if N % i == 0:
            divisor_list.append([i, N //i])

    return divisor_list

divisor_list_max_min = min([max(x) for x in get_divisor_list(N)])



print(len(str(divisor_list_max_min)))

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())
NS = int(sqrt(N))

ret = len(str(N))
for i in range(1, NS + 1):
    if N % i == 0:
        an, bn = (len(str(i)), len(str(N // i)))
        ret = min(max(an, bn), ret)
print(ret)

Submission status: Accepted

Solution code:
import math
n = int(input())
ans = 10**10

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

Submission status: Accepted

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

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

n = int(math.sqrt(N)) 
ans = len(str(N))
for a in range(1,n+1):
    if N % a == 0:
        b = N // a
        res = f(a,b)
        if res < ans:
            ans = res
print(ans)

Submission status: Accepted

Solution code:
#2018-03-11
#mokutou
import math
def digitsum(k):
    return len(str(k))


N = int(input())
m = int(math.sqrt(N))
result=10**10
for i in range(1,m+1):
    if N%i==0:
        A=i
        B=N//i
        F=max([digitsum(A),digitsum(B)])
        if F<result:
            result=F
print(result)

Submission status: Accepted

Solution code:
import math
n=int(input())
x=1
while(x<=n**0.5):
  if(n%x!=0):
    x+=1
  else:
    mins=int(math.log10(n//x))
    x+=1
    
print(mins+1)

Submission status: Accepted

Solution code:
import math


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

if n % a == 0.0:
    b = int(math.log10(a)) + 1
    print(b)
else:
    a = int(a)
    for i in range(a, 0, -1):
    	if n % i == 0:
    		a = n / i
    		break
    b = int(math.log10(a)) + 1
    print(b)

Submission status: Accepted

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

Submission status: Accepted

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)))+1):
    if n % i == 0:
        ans.append(order(n/i,i))

if len(ans) == 0:
    print(1)
else:
    print(min(ans))

Submission status: Accepted

Solution code:
import math
n=int(input())
x=math.floor(n**0.5)

while 1:
  if n % x ==0:
    break
  x-=1

print(max(len(str(int(n/x))),len(str(x))))

Submission status: Accepted

Solution code:
import sys
def main():
    n = int(input())

    mi = sys.maxsize
    for x in range(1, n + 1):
        if x > int(n / x):
            break
        if n % x == 0:
            mi = min(mi, max(len(str(x)), len(str(int(n / x)))))
    print(mi)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())
p, q, r = 1, 1, N
if N % 2 == 0:
    p = 2
    q = 3
n = int(math.sqrt(N))
while q <= n:
    if N % q == 0:
        p = q
    q += 1
ans = len(str(N//p))

print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())
p, q, r = 1, 1, N
if N % 2 == 0:
    p = 2
    q = 3
n = int(math.sqrt(N))
while q <= n:
    if N % q == 0:
        p = q
    q += 1
num = str(max(p, N//p))

ans = len(num)
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
ans = 10000000000
for i in range(int(math.ceil(math.sqrt(n))), 0, -1):
    if n % i == 0:
        ans = min(ans, len(sorted([str(i), str(int(n / i))], key=len)[1]))
print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
https://beta.atcoder.jp/contests/abc057/tasks/abc057_c

"""
import sys
from sys import stdin
input = stdin.readline


def calc_divisors(N):
    ans = [N]
    for i in range(2, int(N**0.5)+1):
        if N % i == 0:
            ans.append(i)
            # if N // i != i:
            #     ans.append(N//i)
    ans.sort()
    return ans


def solve(N):
    min_ans = float('inf')
    divs = calc_divisors(N)

    for d in divs:
        A = d
        B = N // d
        A_len = len(str(A))
        B_len = len(str(B))
        AB_len = max(A_len, B_len)
        min_ans = min(min_ans, AB_len)
    return min_ans


def main(args):
    N = int(input())
    ans = solve(N)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = 1
ans = len(str(N))
while A**2 <= N:
    if N % A != 0:
        # Bが整数にならない
        A += 1
        continue
    B = N // A
    cur = max(len(str(A)), len(str(B)))
    ans = min(ans, cur)
    A += 1
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=[]
for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
        ans.append(n//i)
v=min(ans)
data=int(math.log10(v)+1)
print(data)

Submission status: Accepted

Solution code:
import math

num = int(input())

res = float("inf")
for i in range(1, math.ceil(pow(num, 0.5))+1):
    if num % i == 0:
        if max(len(str(i)), len(str(int(num/i)))) < res:
            res = max(len(str(i)), len(str(int(num/i))))
print(res)

Submission status: Accepted

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.ceil(math.sqrt(N+1))):
    if N % i == 0: elements.append(i)

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

Submission status: Accepted

Solution code:
import math


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

    # 1 * N
    ans = len(str(N))
    sqrt_N = int(math.sqrt(N))
    for i in range(2, sqrt_N + 1):
        if N % i == 0:
            d = N // i
            res = max(len(str(d)), len(str(i)))
            ans = min(ans, res)

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import sqrt


N = int(input())

ans = 10000000000000000
for i in range(1, int(sqrt(N)) + 1):
    if N % i == 0:
        j = N // i
    ans = min(ans, max(len(str(i)), len(str(j))))
print(ans)

Submission status: Accepted

Solution code:
from math import floor, sqrt, log10

N = int(input())

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

Submission status: Accepted

Solution code:
import math
N=input()

def F(x,y):
	return max( len(str(x)),len(str(y)) )


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

        return l

a=div_list(N)

ans=11
for i in a:
	ans=min(ans,F(i,N/i))

print ans

Submission status: Accepted

Solution code:
import math
N=input()

def F(x,y):
	return max( len(str(x)),len(str(y)) )


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

        return l

a=div_list(N)
#print a

ans=11
for i in a:
	ans=min(ans,F(i,N/i))

print ans

Submission status: Accepted

Solution code:
N = int(input())

x = int(pow(N, 0.5))
while N % x != 0:
    x -= 1
print(len(str(N // x)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
    N = int(input())

    min_length = 11
    for a in range(1, int(N ** 0.5) + 1):
        if N % a == 0:
            min_length = min(min_length, max(len(list(str(a))), len(list(str(N // a)))))

    print(min_length)


solve()

Submission status: Accepted

Solution code:
import math
def F(a,b):
    return max(len(str(a)), len(str(b)))
    
def main():
    n =int(input())
    v = F(n,1)
    
    for a in range(1, int(math.sqrt(n))+1):
        if n % a != 0:
            continue
        
        b = n//a
        v = min(v, F(a,b))
    print(v)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())
ret = float('inf')
i = 1

while i * i <= N:
    if N % i == 0:
        ret = min(ret, int(math.log10(N / i)) + 1)
    i += 1

print(ret)

Submission status: Accepted

Solution code:
import math

N = int(input())
ret = float('inf')
i = 1

while i * i <= N:
    if N % i == 0:
        ret = min(ret, int(max(math.log10(i), math.log10(N/i))) + 1)
    i += 1

print(ret)

Submission status: Accepted

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

for A in range(1, int(math.sqrt(N))+2):
  if N % A == 0:
    F = len(str((N//A)))

print (F)

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

Submission status: Accepted

Solution code:
N=int(input())


ans=N
for a in range(1,N):
    if a*a > N:
        break

    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 math

N = int(input())
n = int(math.sqrt(N)) + 1
while N % n != 0:
    n -= 1
print(int(math.log10(N/n) + 1))

Submission status: Accepted

Solution code:
import math

N = int(input())
n = int(math.sqrt(N)) + 1
if N / n == n:
    print(int(math.log10(n) + 1))
else:
    while N % n != 0:
        n -= 1
    print(int(math.log10(N/n) + 1))

Submission status: Accepted

Solution code:
n=int(input())
def keta(a):
    k=1
    while True:
        if 10**(k-1) <= a <10**k:
            break
        k+=1
    return k
from math import sqrt
f=float("inf")
for i in range(1,int(sqrt(n))+1):
    if n%i==0:
        f=min(f,max(keta(i),keta(n//i)))
print(f)

Submission status: Accepted

Solution code:
import math


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


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

    i = 1
    minv = 100000000000
    while i <= int(math.sqrt(n)):
        if n%i == 0 and f(i, n//i) < minv:
            minv = f(i, n//i)
        i += 1
    print(minv)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

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

ans = [0]*2
for i in reversed(range(1, a+1)):
  if N % i == 0:
    ans[0] = i
    ans[1] = N // i
    break
res = 0
for e in ans:
  now = len(str(e))
  if now > res:
    res = now
    
print(res)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

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

Submission status: Accepted

Solution code:
from collections import defaultdict
import math


def main():
    n = int(input())
    ans = float("inf")
    for i in range(1, int(math.sqrt(n)) + 2):
        if n % i == 0:
            ans = min(ans, max(len(str(i)), len(str(n // i))))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math;
 
n = int(input());
a = int(math.sqrt(n));
 
while True:
    b = n // a;
    if n == a * b:
        print(int(math.log10(b))+1);
        break
    a = a-1;

Submission status: Accepted

Solution code:
import math
N=int(input())
m=int(N**(1/2))
while True:
    if(N%m==0):
        print(int(math.log10(N/m)+1))
        break
    else:
        m-=1
        #print(m)
        continue

Submission status: Accepted

Solution code:
import math

n = int(input())
ret = 10000000000000000
for i in range(1, int(math.sqrt(float(n))+5.0)):
    if n % i:
        continue;
    ret = min(ret, max(int(math.log10(n//i)), int(math.log10(i))) + 1)

print(ret)

Submission status: Accepted

Solution code:
import math

N = int(input())

result_set = []

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

result = pow(10, 10)

for i in result_set:
    result = min(result, int(math.log10(max(i)) + 1))


print(result)

Submission status: Accepted

Solution code:
import sys

# sys.stdin = open('c1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


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


n = read_int()
res = 10 ** 20
for a in range(1, n + 1):
    if a * a > n:
        break
    if n % a == 0:
        b = n // a
        f = F(a, b)
        if f < res:
            res = f
print(res)

Submission status: Accepted

Solution code:
def dig(t):
    res = 0
    
    if t == 0:
        return 1
    
    while t > 0:
        t//=10
        res+=1

    return res

n = int(input())

f = 1000000000

for i in range(n+1):
    if i*i > n: break
    if i <= 0 or n%i > 0: continue
    
    f = min(f, max(dig(i), dig(n//i)))
    
print(f)

Submission status: Accepted

Solution code:
import math

N = int(raw_input())

sqn = int(math.sqrt(N))
ans = 100

for A in range(1, sqn + 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:
# _*_ coding:utf-8 _*_

import sys

N = sys.stdin.readline().replace('\n','')
N = int(N)

def Func(a,b):
	if a > b:
		return digit(a)
	else: return digit(b)
		
def digit(num):
	d = len(str(num))
	return d

ans = 10

for i in range(1,N+1):
	if i*i > N: break
	if N % i == 0:
		dum = Func(N//i,i)
		if ans > dum:
			ans = dum

print(ans)

Submission status: Accepted

Solution code:
# -*- coding:utf-8 -*-
import math
N = int(input())
print(min(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))+1) if N%B == 0])))))

Submission status: Accepted

Solution code:
import math
def solve():
  N = int(raw_input())
  yaks = []
  for n in range(1, int(math.sqrt(N)) + 1) :
    if(N % n == 0): yaks.append(n)
  #print yaks
  mind = 999
  for a in yaks:
    b = N / a
    #print(a, b)
    d = max(len(str(a)), len(str(b)))
    #print d
    if d < mind :
      mind = d
  return mind

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

Submission status: Accepted

Solution code:
import math

N = int(input())
end = math.floor(math.sqrt(N))

count = float('inf')
for i in range(1, end + 1):
    if N % i == 0:
        b = str(int(N / i))
        a = str(i)
        c = max(len(a), len(b))
        count = min(c, count)
    else:
        count = count
print(count)

Submission status: Accepted

Solution code:
def keta(N):
  return len(str(N))

N=int(input())
A=1
ans=keta(N)
while A*A <= N:
  if N % A == 0:
    B = N // A
    ans=min(ans,keta(B))
  A += 1
print(ans)

Submission status: Accepted

Solution code:
import math
N=int( input())
for r in range (int(math.sqrt(N)),0,-1):
  if N%r==0:
    count=1
    l=N/r
    for i in range (0,10):
      l=l/10
      if l<1:
        print(count)
        break
      count+=1
    break

Submission status: Accepted

Solution code:
import math
def run(N):
    for x in range(int(math.sqrt(N))+1, 0, -1):
        if N % x == 0:
            return max(len(str(N/x)), len(str(x)))
print run(int(raw_input()))

Submission status: Accepted

Solution code:
n = int(input())

def keta(r):
    cnt = 0
    while r:
        r//=10
        cnt+=1
    return cnt
ans = 1e10
for i in range (1,1000000000):
    if i * i > n :break
    if n%i !=0 :continue
    ans = min(ans,max(keta(n/i),keta(i)))
print(ans)

Submission status: Accepted

Solution code:
N = int(input());

ans = 1000;
for i in range(1, N+1) :
	if i * i > N :
		break;
	if N % i == 0 : 
		m = N / i;
		ans = min(ans, len(str(m)));
print(ans-2);

Submission status: Accepted

Solution code:
import math
n = input()
ans = ()
for x in xrange(1, int(math.sqrt(n))+1):
    if n%x<1:
        ans = min(ans, max(len(str(x)), len(str(n/x))))
print ans

Submission status: Accepted

Solution code:
from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(int(x))))

Submission status: Accepted

Solution code:
from math import sqrt, log10

n = int(input())
for i in range(int(sqrt(n)), 0, -1):
    if n % i == 0:
        print(int(log10(n // i)) + 1)
        break

Submission status: Accepted

Solution code:
N = int(raw_input())

import math
mid = int(math.sqrt(N))

left = mid
while left > 0:
    if not N % left: break
    left -= 1
right = N / left
res = len(str(right))
print res

Submission status: Accepted

Solution code:
N=int(input())

def F(a,b):
    a_digit=len(str(int(a)))
    b_digit=len(str(int(b)))
    if a_digit>b_digit:
        return a_digit
    else:
        return b_digit
min=len(str(N))

for i in range(1,int(N**(0.5))+1):
    if int(N/i)==N/i:
        if F(N/i,i)<min:
            min=F(N/i,i)
            

print(min)

Submission status: Accepted

Solution code:
import sys
import math

n = int(sys.stdin.readline().strip())

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

ans = 10
i = a
while i > 0:
    if n % i == 0:
        m1 = i
        m2 = int(n/i)

        m = max(m1, m2)
        ord_m = int(math.log10(m) + 1)
        ans = min(ans, ord_m)
    i -= 1

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
m = list(map(lambda t:max(len(str(t[0])), len(str(t[1]))),[(r,int(N / r)) for r in range(2, int(N ** 0.5) + 2) if N % r == 0]))
print(min(m) if len(m) != 0 else len(str(N)))

Submission status: Accepted

Solution code:
from math import sqrt

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

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

Submission status: Accepted

Solution code:
import math

N = int(input())
greater = 0
min_greater = 10**10

a = round(math.sqrt(N)) + 1

for i in range(1, a):
	if  N % i == 0:
		greater = max(N / i, i)
	if greater < min_greater:
		min_greater = greater

ans = int(math.log10(min_greater) + 1)

print(ans)

Submission status: Accepted

Solution code:
import math

def digits(num):
    return len(str(num))

N = int(input())
min_d = digits(N)
for i in list(range(2, math.ceil(math.sqrt(N)) + 1, 1)):
    if (N % i == 0):
        min_d = min(max(digits(i),digits(int(N / i))), min_d)
print(min_d)