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:
# -*- coding: utf-8 -*-
import math


def fact(N):
  ret = set()
  for i in range(1,math.ceil(N**(0.5))+1):
    if N % i == 0:
      ret.add(i)
  return ret


if __name__ == "__main__":
  N = int(input())  
  ret = fact(N)
  ans = len(str(N))
  for r in ret:
    ans = min(ans, max(len(str(r)), len(str(N//r))))
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
ans=[]
for i in range(1,int(N**0.5)+1):
    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())

sqrt_N = int(math.sqrt(N))
min_F = float('inf')

for i in range(1,sqrt_N + 1):
    if N % i == 0:
        A = i
        B = N // i
        if min_F > max(len(str(A)),len(str(B))):
            min_F = max(len(str(A)),len(str(B)))

print(min_F)

Submission status: Accepted

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

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

Submission status: Accepted

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

"""考え方
[入力例１]
10000

N = A * B より

A=10000, B=1
A=5000, B=2
A=2500, B=4
A=1250, B=8
A=1000, B=10
A=500, B=20
A=250, B=40
A=200, B=50
A=125, B=80
A=100, B=100
A=50, B=200  <-- ここまで来ると、Bの桁数が大きくなるいっぽうなので、最小値が更新されることはもうない
...

つまり、i = 1 ~ √N までを全探索しても、N<=10**10なので、計算量は高々10**5 これは間に合う。

"""
import math

def F(A, B):
    """ 10進表記における、Aの桁数とBの桁数のうち大きい方を返す """
    def keta(n):
        """ 桁数を求める """
        ans = 1
        while True:
            n = n // 10
            if n == 0:
                break
            ans += 1
        return ans
    
    return max(keta(A), keta(B))
    

def solve():
    N = int(input())
    ans = float("inf")

    for i in range(1, math.ceil(math.sqrt(N))+1):
        A = i
        if N%A != 0: continue
        B = int(N/A)

        ans = min(ans, F(A, B))

    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

"""考え方
[入力例１]
10000

N = A * B より

A=10000, B=1
A=5000, B=2
A=2500, B=4
A=1250, B=8
A=1000, B=10
A=500, B=20
A=250, B=40
A=125, B=80
A=100, B=100
A=50, B=200  <-- ここまで来ると、Bの桁数が大きくなるいっぽうなので、最小値が更新されることはもうない
...

つまり、i = 1 ~ √N までを全探索しても、N<=10**10なので、計算量は高々10**5 これは間に合う。

"""
import math

def F(A, B):
    """ 10進表記における、Aの桁数とBの桁数のうち大きい方を返す """
    def keta(n):
        """ 桁数を求める """
        ans = 1
        while True:
            n = n // 10
            if n == 0:
                break
            ans += 1
        return ans
    
    return max(keta(A), keta(B))
    

def solve():
    N = int(input())
    ans = float("inf")

    for i in range(1, math.ceil(math.sqrt(N))+1):
        A = i
        if N%A != 0: continue
        B = int(N/A)

        ans = min(ans, F(A, B))

    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans=0

for i in range(1,x+1):
    if n%i==0:
        ans=max(i,n//i)

print(len(str(ans)))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
div=[]
for i in range(1,int(n**0.5)+1):
	if n%i==0:
		div.append(i)
		if i!=n//i:
			div.append(n//i)
MIN=float('inf')
for i in div:
	tmp=str(n//i)
	MIN=min(MIN,int(max(len(str(i)),len(tmp))))
print(MIN)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
M=int((N**(1/2)))
mult=0
while 1:
    for i in [-1,1]:
        x=M+i*mult
        if not N%x:
            print(max([len(str(x)),len(str(int(N/x)))]))
            exit()
    mult+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input());print(min(len(str(n//a))for a in range(1,int(n**.5)+1)if n%a<1))

Submission status: Accepted

Solution code:
def divisible_length(n):
    min_length = len(str(n))
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            min_length = min(min_length, max(len(str(i)), len(str(n // i))))
    return min_length

n = int(input())
print(divisible_length(n))

Submission status: Accepted

Solution code:
n = int(input())
def calc(a,b):
    return max(len(str(round(a))),len(str(round(b))))
L = 11
x = int(round(n**(1/2)))
for y in range(1,x+1):
    if n % y == 0:
        if L > calc(n/y,y):
            L = calc(n/y,y)
print(L)

Submission status: Accepted

Solution code:
def divisors(m):
    ds = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            ds.append(i)
            if i != m // i:
                ds.append(m // i)

    return sorted(ds)


n = int(input())
minf = 1e9
for d in divisors(n):
    minf = min(minf, max(len(str(d)), len(str(n // d))))

print(minf)

Submission status: Accepted

Solution code:
n = int(input())
num = 1

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

min_num = 100
while num < n ** (1/2) + 1:
    if n % num == 0:
        min_num = min(min_num, f(n, num))
    num += 1
print(min_num)

Submission status: Accepted

Solution code:
from math import floor

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

n = int(input())

ans = 10

sup = floor(pow(n,1/2))
for p in range(1,sup+1):
    if n % p == 0:
        ans = min(ans,func(p,n//p))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#約数を列挙
def make_divisor(n):
    divisor = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisor.append(i)
    divisor.append(n)
    return divisor

N = int(input())
a = make_divisor(N)

ans = 100
for i in range(len(a)):
    F = max(len(str(a[i])), len(str(N // a[i])))
    ans = min(ans, F)

print(ans)

Submission status: Accepted

Solution code:
#数字の桁を求める関数
def func(num):
    cnt=0
    while(num>0):
        num=int(num/10)
        cnt+=1
    return cnt

N=int(input())
ans=100
#約数全列挙 O(sqrt(N))でできるので間に合う
for i in range(1,int(N**(1/2)+1)):
    #tmpは桁数が入るので最初大きめで持っておく
    tmp=100
    if(N%i==0):
        #問題文通り比較
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
print(ans)

Submission status: Accepted

Solution code:
def func(num):
    cnt=0
    while(num>0):
        num=int(num/10)
        cnt+=1
    return cnt

N=int(input())
ans=100
for i in range(1,int(N**(1/2)+1)):
    tmp=100
    if(N%i==0):
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())
 
def divisor(N):
    '''
    create divisor_list < sqrt(N) from natural number
    '''
    divisor_list = []
    
    for num in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % num == 0:
            divisor_list.append(num)
    
    return divisor_list
    
def F(A, B):
    return max(len(str(A)), len(str(B)))
  
def minimumF(N):
    factoring_list = divisor(N)
    
    candidate_list = []
    
    for A in factoring_list:
        B = N // A
        candidate_list.append(F(A, B))
        
    return min(candidate_list)
  
print(minimumF(N))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
ans = 20
n = int(input())
for i in range(1,n+1):
    if i*i>n:
        break
    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 = 20

for i in range(1,10**5):
    if N%i==0:
        ans = min(ans,len(str(max(i,N//i))))
print(ans)

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

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math

mod = 10**9+7

N = int(input())
ans = 10
for i in range(1,round(math.sqrt(N))+1):
    if N % i == 0:
        f = max(i,N//i)
        f = len(str(f))
        ans = min(f,ans)
    else:
        pass
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())


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


divisors = make_divisors(N)
length = [max(len(divisors[i]), len(divisors[i + 1]))
          for i in range(0, len(divisors), 2)]
print(min(length))

Submission status: Accepted

Solution code:
import math

def all_divisor(n):
    small = [1]
    large = [n]
    for i in range(2, int(n ** 0.5) + 1):
        if not (n % i):
            small.append(i)
            large.append(n//i)
    return large[-1]

n = int(input())
a = all_divisor(n)
print(int(math.log10(a)) + 1)

Submission status: Accepted

Solution code:
N = int(input())
F = 10
for A in range(1,100000):
    if N % A == 0:
        B = N // A
        if len(str(A)) < len(str(B)):
            if len(str(B)) < F:
                F = len(str(B))
        else:
            if len(str(A)) < F:
                F = len(str(A))
print(F)

Submission status: Accepted

Solution code:
#!/usr/bin/env python
import string
import sys
from itertools import chain, dropwhile, takewhile
from math import sqrt


def read(
    *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
    def read_word():
        w = lambda c: c in whitespaces
        nw = lambda c: c not in whitespaces
        return f("".join(takewhile(nw, dropwhile(w, it))))

    if not shape:
        return read_word()
    elif len(shape) == 1:
        return [read_word() for _ in range(shape[0])]
    elif len(shape) == 2:
        return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]


def readi(*shape):
    return read(*shape)


def readi1(*shape):
    return [i - 1 for i in read(*shape)]


def readf(*shape):
    return read(*shape, f=float)


def reads(*shape):
    return read(*shape, f=str)


def arr(*shape, fill_value=0):
    if len(shape) == 1:
        return [fill_value] * shape[fill_value]
    elif len(shape) == 2:
        return [[fill_value] * shape[1] for _ in range(shape[0])]


def dbg(**kwargs):
    print(
        ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
        file=sys.stderr,
    )


def main():
    n = readi()

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

    ans = 10 ** 10
    for i in range(1, int(sqrt(n)) + 1):
        d, m = divmod(n, i)
        if m == 0:
            ans = min(ans, f(d, i))
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1
 
N = int(input())
minimum = 15
for num in range(1,int(N**0.5)+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Submission status: Accepted

Solution code:
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1
 
N = int(input())
minimum = 15
for num in range(1,10**5+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Submission status: Accepted

Solution code:
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1

N = int(input())
minimum = 15
for num in range(1,int(N/(10**5))+10**5+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Submission status: Accepted

Solution code:
N = int(input())

m = 11
s = 1
while s * s <= N:
    if N % s == 0:
        m = min(m,max(map(lambda x:len(str(x)),[s,N//s])))
    s += 1

print(m)

Submission status: Accepted

Solution code:
def div(num):
  ret=[]
  for i in range(1,int(num**0.5)+1):
    if num%i==0:
      ret.append(i)
      ret.append(num//i)
  return ret

n=int(input())
arr=sorted(div(n))
l=len(arr)
ans=10**10
for i in range(l):
  t1=arr[i]
  t2=n//t1
  ans=min(ans,max(len(str(t1)),len(str(t2))))
print(ans)

Submission status: Accepted

Solution code:
import math

N=int(input())

Nmax=round(math.sqrt(N))
Fmin=10000

for i in range(1,Nmax+1):
    if N%i==0 :
        Fmin=min(Fmin, max(len(str(int(i))), len(str(int(N/i)))))

print(Fmin)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
def keta(n):
    if n<10:return 1
    return 1 + keta(n//10)
def yakusuu(n):
    for i in range(int(n**(0.5)),0,-1):
        if n%i == 0:return n//i
print(keta(yakusuu(N)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

mi = 12
for a in range(1, int(N ** 0.5) + 1):
    if N % a == 0:
        mi = min(mi, max(len(str(a)), len(str(N // a))))
print(mi)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 20
for i in range(1, int(N**(1/2)) + 1):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
        if len(str(N//i)) == len(str(i)):
            break

print(ans)

Submission status: Accepted

Solution code:
import math


N = int(input())
borderNum = int(math.sqrt(N))
ans = float("inf")


for a in range(1, borderNum + 1):
    if N % a == 0:
        b = N // a
        numF = len(str(b))
        ans = min(ans, numF)


print(ans)

Submission status: Accepted

Solution code:
import math


N = int(input())
borderNum = int(math.sqrt(N))
ans = float("inf")


for a in range(1, borderNum + 1):
    if N % a == 0:
        b = N // a
        numF = max(len(str(b)), len(str(a)))
        ans = min(ans, numF)


print(ans)

Submission status: Accepted

Solution code:
import math, bisect
N = int(input())
P = [1,N]
for k in range(2,math.floor(math.sqrt(N))+1):
    if N % k == 0:
        P.append(k)
        P.append(N//k)
P = sorted(P)
print(len(str(P[bisect.bisect_left(P,math.sqrt(N))])))

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


print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

def digits(A):
    ans = 1
    while A >= 10:
        A //= 10
        ans += 1
    return ans

def F(A, B):
    return max(digits(A), digits(B))

ans = 11
for A in range(1, int(math.sqrt(N)) + 1):
    B = N // A
    if A * B == N:
        ans = min(ans, F(A, B))
print(ans)

Submission status: Accepted

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

N = int(input())

div = []
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        div.append(i)
        
        p = N // i
        if i != p:
            div.append(p)
        
div.sort()
print(len(str(div[int(len(div) / 2)])))

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    n=int(input())
    ans=10**10
    for i in range(1,int(n**0.5)+1):
        if n%i!=0:
            continue
        b=n//i
        ret=max(c(i),c(b))
        if ans>ret:
            ans=ret
    print(ans)

main()

Submission status: Accepted

Solution code:
import math

N = int(input())
a = int(math.sqrt(N))
while a > 0:
    if N % a == 0:
        b = N // a
        print(max([len(str(a)), len(str(b))]))
        break
    a -= 1

Submission status: Accepted

Solution code:
N = float(input())


def cnt_digits(n):
    digits = 0

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


ans = cnt_digits(N)
A = 1
aa = 1000

while N ** 0.5 >= A:
    A = A+1
    if N % A == 0:
        B = N / A
        if aa > max(cnt_digits(A), cnt_digits(B)):
            aa = max(cnt_digits(A), cnt_digits(B))


if aa < ans:
    print(aa)
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = int(input())

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

ans = len(str(n))
for num in range(1, math.ceil(math.sqrt(n))+1):
    if n % num == 0:
        ans = min(ans, func(num, n//num))

print(ans)

Submission status: Accepted

Solution code:

import math

def read_input():
    n = int(input())
    return n


def submit():
    n = read_input()

    factor_cand = int(math.ceil(math.sqrt(n)))

    while n % factor_cand:
        factor_cand -= 1

        if factor_cand == 1:
            nl = len([c for c in str(n)])
            print(nl)
            return

    a = int(n / factor_cand)
    b = int(factor_cand)

    al = len([c for c in str(a)])
    bl = len([c for c in str(b)])

    print(max(al, bl))



if __name__ == '__main__':
    submit()

Submission status: Accepted

Solution code:
N = int(input())
ans = 10**10 #適当に初期化
ans_ = 10**10

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

Submission status: Accepted

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

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

print(len(str(ans)))

Submission status: Accepted

Solution code:
def f(a,b):
  return max(len(str(a)),len(str(b)))
n=int(input())
lim=int(n**0.5)+1
ans=10
for i in range(1,lim):
  if n%i==0:
    ans=min(ans,f(i,n//i))
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
x = int(n ** 0.5 + 1)
while(True):
    if n % x == 0:
        a = x
        b = n // x
        break
    else:
        x -= 1
print(max(len(str(a)), len(str(b))))

Submission status: Accepted

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

x = int(input())

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

    # divisors.sort()
    return divisors

print(len(str(make_divisors(x)[-1])))

Submission status: Accepted

Solution code:
def digit(n):
    res = 0
    while n != 0:
        n //= 10
        res += 1

    return res


n = int(input())
resa = 1
for i in range(int(n**(1/2)),1,-1):
    if n/i-n//i == 0:
        resa = i
        break

resb = n // resa

print(max(digit(resa), digit(resb)))

Submission status: Accepted

Solution code:
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N))+1) :
    A = i
    B = int(N / A)
    if N % A == 0:
        if A >= B :
            m = int(log10(A)) + 1
        else :
            m = int(log10(B)) + 1
        if m < ans :
            ans = m
            #print(ans)
            #print('{0},{1}'.format(A,B))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 10**11
for A in range(1, int(N**(0.5)) + 1):
    if N % A == 0:
        B = N // A
        ans = min(ans, len(str(max(A, B))))

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
l=lambda j:len(list(map(int,str(j))))
for i in range(int(n**.5),0,-1):
  if n%i==0:
    v=max(l(n//i),l(i))
    break
print(v)

Submission status: Accepted

Solution code:
def ten_count(n):
    cnt=0
    while True:
        n=n/10
        cnt+=1
        if n < 1:
            break
    return cnt

N=int(input())
  
ans_list=[]
for i in range(1,int(N**0.5)+2):
    if N%i==0:
        A=int(i)
        B=int(N/i)
        
        a=ten_count(A)
        b=ten_count(B)
        
        ans_list.append(max(a,b))
        
print(min(ans_list))

Submission status: Accepted

Solution code:
def digit(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans

N = int(input())

check = 100
for i in range(1, int(1e6)):
    if N % i != 0:
        continue
    if N // i < i:
        break
    j = N // i
    f = max(digit(i), digit(j))
    check = min(check, f)

print(check)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# vim: set fileencoding=utf-8:


def main():
    N = int(input())
    divisors = make_divisors(N)
    ans = 10000000000000000000000000

    if pow(divisors[-1], 2) == N:
        ans = kansuu(divisors[-1], divisors[-1])
    else:

        for idx in range(0, len(divisors)-1, 2):
            ans = min(ans, kansuu(divisors[idx], divisors[idx+1]))

    print(ans)


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

    # divisors.sort()
    return divisors


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())

F = 10**12
for i in range(int(sqrt(N))):
    if N % (i+1) == 0:
        cand = max([len(str(int(i+1))), len(str(int(N/(i+1))))])
        if F > cand:
            F = cand
print(cand)

Submission status: Accepted

Solution code:
n = int(input())
if n == 1:
    print(1)
    exit()
a = 1
b = n
for i in range(1, 10**5):
    if n % i == 0:
        if i > n // i:
            print(min(len(str(i)), len(str(b))))
            exit()
        a = i
        b = n // i
print(len(str(b)))

Submission status: Accepted

Solution code:
import math

def F(A,B):
    if A > B:
        return len(str(A))
    else:
        return len(str(B))
            

N = int(input())
min = F(1,N)
rt = int(math.sqrt(N))
for i in range(2,rt+1):
    if N % i != 0:
        continue
    f = F(i,int(N/i))
    if f < min:
        min = f
print(min)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=_I()

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

#高々10**5まで見れば良い
ans=inf
for i in range(1,min(N+1,10**5+3)):
	if N%i==0:
		ans=min(ans,F(i,int(N/i)))
#ans=min(ans, F(1,N))
print(ans)

Submission status: Accepted

Solution code:
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def pf(s): return print(s, flush=True)

N=_I()

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

#高々10**5まで見れば良い
ans=inf
for i in range(1,min(N,10**5+3)):
	if N%i==0:
		ans=min(ans,F(i,int(N/i)))
ans=min(ans, F(1,N))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 100
for i in range(1, int(n**0.5)+2):
    if n % i == 0:
        ans = min(ans, max(len(str(n//i)), len(str(i)))) 

print(ans)

Submission status: Accepted

Solution code:
# 14 : 05 - 14 : 18
import math
N = int(input())
for_max = math.ceil(math.sqrt(N))
ans = 10 ** 18

for i in range(1, for_max + 1):
    if N % i == 0:#dividible
        a = N // i
        b = i
        #digit = log10(N) + 1
        func = max(math.log10(a) + 1, math.log10(b) + 1)
        func = int(func)
        ans = min(ans, func)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
m = math.ceil(math.sqrt(n))
for i in range(m, -1, -1):
    if n % i == 0:
        print(max(len(str(i)), len(str(n // i))))
        exit()

Submission status: Accepted

Solution code:

import math
n = int(input())
a = 1
b = 1
for i in range(1, math.floor(math.sqrt(n))+1):
  if n % i == 0:
    a = n / i
    
b = n / a
print(max([len(list(str(int(a)))), len(list(str(int(b))))]))

Submission status: Accepted

Solution code:
from math import sqrt, ceil

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

    up_b = ceil(sqrt(N))

    min_a = 10 ** 10
    for b in range(up_b):
        if N % (b+1) == 0:
            min_a = min(max(N/(b+1), b+1), min_a)
            min_a = int(min_a)
    
    print(len(str(min_a)))
        
main()

Submission status: Accepted

Solution code:
N = int(input())

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

def isPrime(n):
    if n < 2:
        return False
    elif n == 2:
        return True
    else:
        for i in range(2, int(n**(1/2))+1):
            if n%i == 0:
                return False
        return True

if isPrime(N):
    print(f(N, 1))
else:
    ans = 10**20
    for i in range(1, int(N**(1/2))+1)[::-1]:
        if N%i == 0:
            ans = min(ans, f(N//i, i))
    print(ans)