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:
n=int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


can=make_divisors(n)

ans=10**9

for g in can:
    
    ans=min(ans,max(len(str(g)),len(str(n//g))))


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
# import numpy as np
sys.setrecursionlimit(int(pow(10,6)))
# sys.stdin = open("input.txt", "r")
# sys.stdout = open("output.txt", "w")
mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]

# @lru_cache(None)

N=l()[0]
F=10**10

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

Submission status: Accepted

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

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

start_num = int(math.sqrt(N))


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

output = checkDisits(a, b)
print(output)

Submission status: Accepted

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

n = int(input())
divlist =  [0] + make_divisors(n)
print(len(str(divlist[divlist.index(divlist[-1])//2 + 1])))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
import math
N=int(input())
#考えるべき範囲
ans=11
#絶対ありえない数を定義しておく
for i in range(1,int(math.sqrt(N))+1):
    if N%i !=0:
        continue
    else:
        A=N//i
        A=str(A)
        i=str(i)
        F=max(len(A),len(i))
        if F<ans:
            ans=F

print(ans)

Submission status: Accepted

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


def digit(k,c=0):
    if k == 0:
        return c
    else:
        return digit(k//10,c+1)

def solve(n):
    l = []
    for i in range(round(n**(1/2))):
        a = i+1
        if n % a != 0:
            continue
        b = n // a
        l.append(max(digit(a),digit(b)))
    return min(l)



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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N= int(input())
mn = 100
ref = 100
for i in range(1,int(math.sqrt(N))+1):
    if N%i == 0:
        #print(i,int(N/i))
        ref = max(len(str(i)),len(str(int(N/i))))
        #print(mn,ref)
        if ref < mn:
            mn = ref
print(mn)

Submission status: Accepted

Solution code:
N = int(input())

A = []
B = []
i = 1

while i*i <= N:
  if N % i == 0:
    A.append(i)
    B.append(N//i)
  i += 1

rlt = 13
for b in B:
  rlt = min(rlt,len(str(b)))

print(rlt)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = []

for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        l.append(max(len(str(a)), len(str(b))))

print(min(l))

Submission status: Accepted

Solution code:
n = int(input())
l = []

for a in range(1, int(n**0.5) + 1):
    if n % a == 0:
        b = n // a
        f = max(len(str(a)), len(str(b)))
        l.append(f)

print(min(l))

Submission status: Accepted

Solution code:
N=int(input())
result=0
count = 1
while count*count <= N:
  if N % count == 0:
    result=count
  count+=1
print(len(str(N//result)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
import math
root_n = math.floor(pow(n,0.5))
ans = len(str(n))
for i in range(root_n,0,-1):
  if n%i==0:
    print(len(str(n//i)))
    exit()
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
figure = []
for i in range(1, int(math.sqrt(N))+1):
  if N % i == 0:
    figure.append([i, N/i])
  else:
    continue
cnt_list = []
for l in range(len(figure)):
  cnt = 1
  Max = max(figure[l])
  while Max // 10 >= 1:
    cnt += 1
    Max /= 10
  cnt_list.append(cnt)
print(min(cnt_list))

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math


N = int(input())

AB = []

for a in range(1, int(N ** 0.5) + 1):
    if N % a == 0:
        b = math.log10(N // a) + 1
        a = math.log10(a) + 1
        AB.append((a, b))

ans = min([max(a, b) for a, b in AB])
print(int(ans))

Submission status: Accepted

Solution code:
import sys

def isPrime(n):
    isP = True
    i = 2
    while i*i <= n :
        if n % i == 0:
            isP = False
        i += 1
    
    return isP

def keta_chk(n):
    keta = 0
    while n > 0:
        keta += 1
        n = int(n/10)
    
    return keta

def solve(n):
    ans = sys.maxsize
    i = 1
    while i*i <= n:
        if n % i == 0:
            f = max(keta_chk(int(n/i)),keta_chk(i))
            ans = min(f,ans)
        i += 1
    
    return ans

n = int(input())
ans = solve(n)
print(ans)

Submission status: Accepted

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

    m = int(n ** 0.5)
    if n < 4:
        m += 1

    min_f = len(str(n))

    for i in reversed(range(1, m + 1)):
        if n % i == 0:
            b = n // i
            db = len(str(b))
            di = len(str(i))
            f = max(db, di)
            if f < min_f:
                min_f = f

    print(min_f)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
def factorization(n): #素因数分解のプログラム([素因数,指数]のリストのリストで出力→24→[[2, 3], [3, 1]])
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            for _ in range(cnt):
                arr.append(i)

    if temp!=1:
        arr.append(temp)

    if arr==[]:
        arr.append(n)

    return arr
ls = factorization(n)
mn = float("inf")
for i in range(2**len(ls)):
    a = 1
    for j in range(len(ls)):
        if (i>>j)&1:
            a *= ls[j]
    if a <= n**(1/2):
        b = int(n/a)
        m = max(len(str(a)),len(str(b)))
        if m < mn:
            mn = m
print(mn)

Submission status: Accepted

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

class Factorization:	
	def __init__(self):
		# privateなインスタンス変数を作成
		self.__factors = dict()
		self.__n = 0
	
	
	def get_factors(self, n):
		# [summary] 素因数分解した結果を、辞書([素因数, 指数]...)で返す
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			# 2より小さい数の場合、素因数分解できない
			return { n:1 }
		else:
			self.__factorization()
			
			return self.__factors
	
	
	def get_divisors(self, n):
		# [summary] 約数をリストに列挙
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return [1]
		else:
			self.__factorization()
			divisors = [1]
			
			for k, v in self.__factors.items():
				import copy
				copy_ = copy.deepcopy(divisors)
								
				for i in range(1, v + 1):
					for c in copy_:
						divisors.append(c * (k ** i))
			
			return divisors

				
	def count_divisors(self, n):
		# [summary] 約数の個数を返す
		self.__factors.clear()
		self.__n = n
		
		if n < 2:
			return 1
		else:
			self.__factorization()
			count = 1
			
			for v in self.__factors.values():
				count *= v + 1
			
			return count
	

	def	__factorization(self):
		# [summary]素因数分解した結果を、インスタンス変数に格納
		
		# 2,3,5で、割れなくなるまで割り続ける
		# (末尾に2,3,5のつく数は素数でないことが明白なので
		# 後続の処理で素数のリストに入れないように、先に処理する)
		self.__divide_with(2)
		self.__divide_with(3)
		self.__divide_with(5)
			
		# 平方根以下の素数で総当たりで試し割りする
		# (実際は、素数らしき数)
		import math
		sqrt_ = math.floor(math.sqrt(self.__n))
			
		primes = [7, 11, 13, 17, 19, 23, 29, 31]
		i = 0
		is_break = False
			
		while self.__n > 1:
			for p in primes:
				if p + i <= sqrt_:
					self.__divide_with(p + i)
				else:
					# 試し割りする数が平方根を超えたら、ループを抜ける
					is_break = True
						
					# 1が素因数に追加されることを防止
					if self.__n > 1:
						self.__factors.setdefault(self.__n, 1)
				
			if is_break:
				break
			else:
				i += 30
	
	
	def __divide_with(self, d):
		count = 0
		
		while self.__n % d == 0:
			self.__n //= d
			count += 1
		
		if count > 0:
			self.__factors.setdefault(d, count)


# C - Digits in Multiplication
n = int(input())

lib = Factorization()
divisors = lib.get_divisors(n)
divisors.sort()

ans = len(str(n))

for a in divisors:
	if a > n / 2:
		break
	else:
		b = n // a
		f = max(len(str(a)), len(str(b)))
		ans = min(ans, f)

print(ans)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n = int(readline())

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
from itertools import *


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def S(): return sys.stdin.readline().rstrip()


def LS(): return list(sys.stdin.readline().rstrip().split())


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


N = I()
ans_list = []
divi_list = make_divisors(N)

for i in range(len(divi_list)):
    for q in range(len(divi_list)):
        if divi_list[i] * divi_list[q] == N:
            ans_list.append(
                max(len(str(divi_list[i])), len(str(divi_list[q]))))
print(min(ans_list))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def resolve():
    import math
    N = int(input())
    A = []
    B = []
    for i in range(1, math.floor(math.sqrt(N))+1):
        if N%i == 0:
            A.append(i)
            B.append(N//i)
    print(max(len(str(A[-1])), len(str(B[-1]))))
resolve()

Submission status: Accepted

Solution code:
def enum_divisors(n):
    res = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            res.append(i)
    return res


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


N = int(input())
ans = float("inf")
for n in enum_divisors(N):
    ans = min(ans, F(n, N // n))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
min = 10**10
for i in range(1, int(N**0.5+1)):
    if N % i == 0:
        b = N // i
        if i <= b and len(list(map(int, str(b)))) < min:
            min = len(list(map(int, str(b))))
        elif i > b:
            break

print(min)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

def score(x):
    global n
    return len(str(max(x, n//x)))

ans = len(str(n))

for i in range(1, int(n ** 0.5) + 2):
    if n % i == 0:
        ans = min(ans, score(i))

print(ans)

Submission status: Accepted

Solution code:
import sys
readline = sys.stdin.buffer.readline
def even(n): return 1 if n%2==0 else 0

n = int(readline())

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

print(ans)

Submission status: Accepted

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

for a in range(1,int(N**0.5+1)):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))

Submission status: Accepted

Solution code:
N = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def digit(n):
    i = 0
    while n != 0:
        n = n // 10
        i += 1
    return i

divisor_list = make_divisors(N)

length = len(divisor_list)

if length % 2 == 0:
    ans = max(digit(divisor_list[length//2 - 1]),digit(divisor_list[length//2]))
else:
    ans = digit(divisor_list[length//2])

print(ans)

Submission status: Accepted

Solution code:
import math
#import numpy as np
import queue
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
    i = 1
    mi = -1
    while i**2 <= n:
        if n%i == 0:
            a = str(i)
            b = str(n//i)
            mi = max(len(a),len(b))
        i += 1
    print(mi)


    return

if __name__ == '__main__':
    main()

Submission status: Accepted

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

from itertools import combinations
from functools import reduce
from operator import mul

N = int(input())
p = prime_factorize(N)
ans = len(str(N))
for i in range(1,len(p)//2+1):
    for x in combinations(p,i):
        t1 = reduce(mul,x)
        t2 = N // t1
        ans = min(ans,max(len(str(t1)),len(str(t2))))
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            upper_divisors.append(n//i)
        i += 1
    return lower_divisors , upper_divisors

l,u=make_divisors(n)

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

Submission status: Accepted

Solution code:
#!python3

# input
N = int(input())


def main():
    n = int(N ** 0.5)
    for a in range(n, 0, -1):
        if N % a == 0:
            b = N // a
            ans = len(str(b))
            print(ans)
            return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())

ans = float('inf')

for a in range(1, int(sqrt(N)) + 1):
  if N % a == 0:
    A = str(a)
    B = str(N // a)
    F = max(len(A), len(B))
    ans = min(ans, F)

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
divisors = []    
i = 1
while i*i <= n:
    if n % i == 0:
        divisors.append(i)
    i += 1
print(len(str(n//divisors[-1])))

Submission status: Accepted

Solution code:
n=int(input())

def make_divisors(n):
    l_d,u_d=[],[]
    i=1
    while i**2<=n:
        if n%i==0:
            l_d.append(i)
            if i!=n//i:
                u_d.append(n//i)
        i+=1
    return l_d

l_d=make_divisors(n)
ans=10**9
for j in l_d:
    ans=min(ans,max(len(str(j)),len(str(n//j))))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def p(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
def P(L):
  P = 1
  for c in range(len(L)):
    P = P*L[c]
  return P  
N = int(input())
A = p(N)
F = []
for i in range(2**(len(A))):
  B = []
  C = []
  for j in range(len(A)):
    if(i>>j&1):
      B.append(A[j])
    else:
      C.append(A[j])
  F.append(max(len(str(P(B))),len(str(P(C)))))
  
print(min(F))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def divisor(n):
    d = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            d.append(i)
    return d

n = int(input())
def solve():
    for a in divisor(n):
        b = n // a
        yield max(len(str(a)), len(str(b)))

print(min(solve()))

Submission status: Accepted

Solution code:
def divisor(n):
    d = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            d.append(i)
            if n % (n//i) == 0:
                d.append(n//i)
    d.sort()
    return d

n = int(input())
def solve():
    for a in divisor(n):
        b = n // a
        yield max(len(str(a)), len(str(b)))

print(min(solve()))

Submission status: Accepted

Solution code:
N=int(input())
A_yaku=[]
B_yaku=[]
B_keta=[]
A=1
B=1

while A*A<=N:
    if N % A == 0:
        A_yaku.append(A)
        B=int(N/A)
        B_yaku.append(B)
    A+=1

for i in B_yaku:
    keta=1
    while int(i / 10) != 0:
        i = i / 10
        keta+=1
    B_keta.append(keta)

ans = min(B_keta)

print(ans)

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())

ans = 1e12
for i in range(1,int(((np.sqrt(n))+1)//1)+1):
    if n%i == 0:
        tmp = len(str(n//i))
        if ans > tmp:
            ans = tmp
        else:
            continue
            
print(ans)

Submission status: Accepted

Solution code:
def main():
    def f(a, b):
        return max(len(str(a)), len(str(b)))
    def make_divisors(n):
        divisors = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0:
                divisors.append(i)
                if i != n // i:
                    divisors.append(n//i)
        return divisors
    n = int(input())
    divisors = make_divisors(n)
    ans = float('inf')
    for a in divisors:
        b = n // a
        ans = min(ans, f(a, b))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N = 10000
N = 1000003
N = 9876543210

N = int(input())


def calculate(n):
    mid = math.ceil(math.sqrt(n))
    res = -1
    while mid>=0:

        if n % mid == 0:
            s = n // mid
            res =  max(len(str(s)),len(str(mid)))
            break
        mid = mid - 1



    if res== -1:
        print(len(str(n)))
    else:
        print(res)


calculate(N)

Submission status: Accepted

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

Submission status: Accepted

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


n = int(input())

A = divisors(n); B = A[::-1]

ans = float("inf")
for a, b in zip(A, B):
    tmp = max(len(str(a)), len(str(b)))
    ans = min(ans, tmp)

print(ans)

Submission status: Accepted

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

N = int(input())
n = N
ans = N

for _ in range(1,int(math.sqrt(n))+1):
  if n % _ == 0:
#    print("{}: {} {}".format(f(_,N/_),_,int(N/_)))
    if ans >= f(_,int(N/_)):
      ans = f(_,int(N/_))
    else:
      break
print(ans)

Submission status: Accepted

Solution code:
def F(A,B):
    if A <= B:
        B = str(B)
        return len(B)
    else:
        A = str(A)
        return len(A)

if __name__ == '__main__':
    import math
    N = int(input())
    min = F(1,N)
    for i in range(1,int(math.sqrt(N))+1):
        if N % i == 0:
            a = F(i,N//i)
            if a < min:
                min = a

    print(a)

Submission status: Accepted

Solution code:
n = int(input())
sqrt = round(n ** 0.5) + 1
f_min = float('inf')
for i in range(1, sqrt + 1):
    if not n % i:
        a = str(i)
        b = str(n // i)
        f = max(len(a), len(b))
        f_min = min(f_min, f)
print(f_min)

Submission status: Accepted

Solution code:
import math

n=int(input())
for i in range(int((n**0.5+1)//1),0,-1):
    if n/i%1==0:
        f=max(len(str(i)),len(str(n//i)))
        break
print(f)

Submission status: Accepted

Solution code:
N = int(input())

A = 0
min_score = len(str(N))

while True:

    A += 1

    if A * A > N:
        break

    if N%A != 0:
        continue

    B = N//A

    # check
    cur = max([len(str(A)), len(str(B))])
    if min_score > cur:
        min_score = cur

print(min_score)

Submission status: Accepted

Solution code:
import math
import sys
INFTY=sys.maxsize

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

def main(n):
    fmin=INFTY
    m=int(math.sqrt(n))+1
    for a in range(1,m+1):
        if(n%a==0):
            b=n//a
            f=max(len(str(a)), len(str(b)))
            fmin=min(fmin,f)
    return fmin

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)

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:
import math
n = int(input())
k = int(math.sqrt(n))
for i in range(k+2,0,-1):
  if n%i == 0:
    a = n//i
    break
s = len(str(a))
print(s)

Submission status: Accepted

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

Submission status: Accepted

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



N = int(input())
ans = []

list_divisor = divisor(N)

for a in list_divisor:
    b = N // a
    len_a = len(str(a))
    len_b = len(str(b))
    ans.append(max(len_a,len_b))

print(min(ans))

Submission status: Accepted

Solution code:
import math

def main():
    N = int(input())
    ans_list = []
    temp =int(math.sqrt(N) // 1)

    for i in range((temp + 1)):
        if i == 0:
            continue
        elif (N % i) != 0:
            continue
        elif (N % i) == 0:
            ans_list.append([i, N/i])
    result =ans_list[len(ans_list) - 1][1]

    j = 1
    while True:
        result = result // 10
        if result == 0:
            return j
        j += 1

print(main())

Submission status: Accepted

Solution code:
def fdigit(a,b):
    if len(str(a)) > len(str(b)):
        return len(str(a))
    else:
        return len(str(b))

N = int(input())
result = 10000000000
goal = int((N**0.5)//1)

for i in range(1, goal+1):
    if N%i ==0:
        #print(i)
        if result > fdigit(i, N//i):
            result = fdigit(i, N//i)
            #print(i, N/i,fdigit(i, N//i))

print(result)

Submission status: Accepted

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

N = int(readline())

ans = 10
for a in range(1, int(N ** 0.5) + 1):
  if N % a == 0:
    b = N // a
    f = max(len(str(a)),len(str(b)))
    if ans > f:
      ans = f
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import itertools
import copy

input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

n = I()

def make_divisors(n):
    result = []
    i = 1
    while i*i <= n:
        if n % i == 0:
            result.append(max(len(str(i)), len(str(n // i))))
        i += 1
    return result

result = make_divisors(n)
print(min(result))

Submission status: Accepted

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

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

# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(input())

ds = set()
dl = list()
for i in range(1,10**5+1):
    if N%i == 0:
        ds.add(i)
        dl.append(i)
for d in dl:
    ds.add(N//d)
D = sorted(list(ds))

ans = 100
for d in D:
    ans = min(ans,F(d,N//d))

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

# F(A*B) = F(B*A) なのでnの半分の数までの繰り返しで良い
a = int(n**0.5)

# n/2を割り切れる最大の数を探す
while n % a != 0:
      a -= 1
# a*b=n より
b = n//a
# 大きい数の文字数を返せば良い
print(len(str(max(a,b))))

Submission status: Accepted

Solution code:
n = int(input())

def makediv(n):
	lower_divisors , upper_divisors = [], []
	i = 1
	while i*i <= n:
		if n % i == 0:
			lower_divisors.append(i)
			if i != n // i:
				upper_divisors.append(n//i)
		i += 1
	return lower_divisors + upper_divisors[::-1]

ans = 10**18
divn = makediv(n)
for i in divn:
	if i*i <= n:
		ans = min(max(len(str(n//i)), len(str(i))), ans)
print(ans)

Submission status: Accepted

Solution code:
import numpy
s = list(map(int, input().split()))
n=s[0]
ans=11
for a in range(1,int(numpy.sqrt(n))+1):
    b=n/a
    if b.is_integer():
        b=int(b)
        if max(len(str(a)),len(str(b)))<ans:
            ans = max(len(str(a)), len(str(b)))
print(ans)

Submission status: Accepted

Solution code:
def func(i, j):
  il = len(str(i))
  jl = len(str(j))
  if il > jl:
    return il
  return jl

n = int(input())
min = len(str(n))
for i in range(1, n+1):
  if i**2 > n:
    break
  if n % i == 0:
    fr = func(i, int(n/i))
    if min > fr:
      min = fr
print(min)

Submission status: Accepted

Solution code:
import math

N = int(input())

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

print(len(str(max(sosuu, B))))

Submission status: Accepted

Solution code:
def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

N = int(input())

res = 1e+9
for i in make_divisors(N):
    j = N//i
    ans = max(len(str(i)),len(str(j)))
    res = min(res,ans)

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

print(min(l))

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

i = 1
ab = set()
while i ** 2 <= n:
    if n % i == 0:
        ab.add((i, n // i))
    i += 1

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

ans = 10 ** 10
for a, b in ab:
    ans = min(ans, max(digit(a), digit(b)))

print(ans)

Submission status: Accepted

Solution code:
N=int(input())

count=0
lis=[]


for i in range(1,N+1):
	if N/i < i:
		break
	if N/i==N//i:
		lis.append(i)

llis=[]
for x in lis:
	y = N / x
	mm=max([x,y])

	ketasuu=len(str(int(mm)))
	llis.append(ketasuu)


print(min(llis))

Submission status: Accepted

Solution code:
def divisors_lower(n):
    lower = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower.append(i)
        i += 1
    return lower

n = int(input())

ans = 10 ** 11
A = divisors_lower(n)
for a in A:
    b = n // a
    a, b = str(a), str(b)
    l = max(len(a), len(b))
    ans = min(ans, l)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

ans = n
for q in range(1, int(n ** 0.5) + 1):
    if not n % q:
        ans = min(ans, len(str(n // q)))

print(ans)