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

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:
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
  
N=int(input())
divs=make_divisors(N)
print(len(str(divs[len(divs)//2])))

Submission status: Accepted

Solution code:
N = int(input())
ans = 10**9+7
def divisore(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(reverse=True)
    return divisors
li = divisore(N)
n = len(li)
if n % 2 == 0:
    for i in range(n//2):
        j = i+1
        j = j * (-1)
        left = len(str(li[i]))
        right = len(str(li[j]))
        k = max(left,right)
        if k <= ans:
            ans = k
    print(ans)
    exit()
else:
    l = int(N**(1/2))
    print(len(str(l)))

Submission status: Accepted

Solution code:
n = int(input())

def myfunc(a, b):
    if len(str(a)) > len(str(b)):
        return len(str(a))
    return len(str(b))

ans = len(str(n))
i = 1
sqrt_n = n ** 0.5
while i <= sqrt_n:
    if n % i == 0:
        ans = min(ans, myfunc(i, n // i))
    i += 1

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np

def list_prime(max):
    primes = []
    for i in range(1, max):
        if max % i == 0:
            primes.append(i)
        if i >= np.sqrt(max):
            break
    if len(primes) <= 1:
        primes.append(max)
    return primes

def solve(N: int):
    print(len(str(max(int(N / list_prime(N)[-1]), list_prime(N)[-1]))))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N=int(input())

P=math.sqrt(N)
ans=float("inf")
for i in range (1,int(P+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())

from math import sqrt

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

Submission status: Accepted

Solution code:
n=int(input())

num=int(n**0.5)+1
mini=float('inf')
for k in range(1,num+1):
    i=k
    j=0
    if n%i==0:
        j=n//i
    if j!=0 and len(str(j))<=mini:
        mini=len(str(j))
print(mini)

Submission status: Accepted

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


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


def read_list():
    return list(read_values())


def read_lists(N):
    return [read_list() for n in range(N)]


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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 1000
for k in range(1,math.floor(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())

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

ans = N
i = 1
while i <= N**0.5:
    if N%i == 0:
        ans = min(ans, f(i, N//i))
    i += 1

print(ans)

Submission status: Accepted

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

    def trial_division(n):
        divs = []
        for i in range(1, int(n**0.5)+1):
            if n % i == 0 and i != n//i:
                divs.append((i, n//i))
            elif n % i == 0 and i == n//i:
                divs.append((i, i))
        return divs
    ans = 10**13
    divs = trial_division(N)
    for a, b in divs:
        ans = min(ans, max(len(str(a)), len(str(b))))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())


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


ans = 10**9
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        j = N // i
        ans = min(ans, F(i, j))

print(ans)

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N = I()

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

    ans = inf
    for i in range(1,int(sqrt(N)+1)):
        if N%i==0:
            ans = min(ans, f(i, N//i))
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def max_digit(numA, numB):
    a = len(str(numA))
    b = len(str(numB))
    return max(a, b)
ans = 10
n = int(input())
for i in range(1, int(n ** 0.5) + 1):
    if n % i != 0:
        continue
    result = max_digit(i, n // i)
    if ans > result:
        ans = result
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()

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

arr=mdiv(n)
#print(arr)
print(len(str(min(arr))))

Submission status: Accepted

Solution code:
n=int(input())
ans=10**20
for x in range(1,10**5+1):
    if n%x==0:
        ans=min(ans,max(len(str(x)),len(str(n//x))))
print(ans)

Submission status: Accepted

Solution code:
import math

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

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

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(i)
            if i != n//i:
                divisors.append(n//i)

    return divisors
l=make_divisors(N)
if len(l)%2==0:
    A=l[-2]
    B=l[-1]
    a=str(A)
    b=str(B)
    ans=max(len(a),len(b))
else:
    A=l[-1]
    B=l[-1]
    a=str(A)
    ans=len(a)
print(ans)

Submission status: Accepted

Solution code:
def f(a, b):
    A = 1
    B = 1

    while True:
        if a // 10 > 0:
            A += 1
            a = a // 10
        else:
            break

    while True:
        if b // 10 > 0:
            B += 1
            b = b // 10
        else:
            break

    return max(A, B)
# ============================

N = int(input())

ans = 10 ** 10
for i in range(1, int(N ** (1/2) + 1)):
    if N % i == 0:
        A = i
        B = N // i
        ans = min(ans, f(A, B))
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
def MaxDigits(A, B):
    Adig = 0
    while A > 0:
        A //= 10
        Adig += 1
    Bdig = 0
    while B > 0:
        B //= 10
        Bdig += 1
    return max(Adig, Bdig)

N = int(input())
infinity = float('inf')
ans = infinity

for i in range(1, int(N**0.5) + 1):
    if N%i == 0:
        if ans > MaxDigits(i, N/i):
            ans = MaxDigits(i, N/i)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())


def digits(n):
    return len(list(str(n)))


digit_list = []
for a in range(1, int(N**(1/2))+1):
    b = N // a if N % a == 0 else 0
    if b != 0:
        digit_list += [max(digits(a), digits(b))]

print(min(digit_list))

Submission status: Accepted

Solution code:
n = int(input())
sn = int(n**.5)
if (sn)*(sn)==n:
    print(len(str(sn)))
    quit()

divisors = []
c = 0
for i in range(int(n**.5)+1, 0, -1):
    if n % i == 0:
        divisors.append(i)
        c += 1
        if i != n // i:
            divisors.append(n//i)
            c += 1
    if c >= 2:
        break

print(len(str(max(divisors))))

Submission status: Accepted

Solution code:
from math import floor, sqrt

def solve(n):
    rn = floor(sqrt(n)) + 1
    for i in range(rn, 0, -1):
        if n % i == 0:
            return max(len(str(n // i)), len(str(i)))

_n = int(input())
print(solve(_n))

Submission status: Accepted

Solution code:
from itertools import combinations

N = int(input())

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

a = i = 1
list = []
while a <= N:
    if N % i == 0:
        b = N // i
        c = N // b
    list.append(max(int_len(b), int_len(b)))
    
    i += 1
    a = i ** 2

ans = min(list)
print(ans)

Submission status: Accepted

Solution code:
def make_divisors(n):
    divisors = []
    ans = float('INF')
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            c = max(len(str(i)), len(str(n//i)))
            if c < ans:
                ans = c
    print(ans)
    # divisors.sort()
    return divisors

n = int(input())
div = make_divisors(n)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from numpy import sqrt
n=int(input())
r=int(sqrt(n))
for i in range(r):
  if n % (r-i) == 0:
    m = n // (r-i)
    print(len(str(m)))
    exit()

Submission status: Accepted

Solution code:
n = int(input())

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

print(f)

Submission status: Accepted

Solution code:
def fab(x):
    if x == 1:
        return x

    ans = 0
    for i in range(1 , x + 1):
        if -(-x // i) < i:
            return ans
        if x % i == 0:
            ans = len(str(int(x / i)))

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

if __name__ == '__main__':
    main()

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

Submission status: Accepted

Solution code:
def sqrt(n):
    i=0
    while n>=(i+1)**2:
        i=i+1
    return i

def digit(n):
    if n<10:
        return 1
    else:
        return 1+digit(n//10)

N=int(input())
i=sqrt(N)
while i>0:
    if N%i==0:
        print(digit(N//i))
        break
    else:
        i=i-1

Submission status: Accepted

Solution code:
N = int(input())
answer = 10**10
M = int(N**0.5)+1

for a in range(1,M):
    if N%a==0:
        b = N//a
        F = max(len(str(a)),len(str(b)))
        answer = min(answer,F)
print(answer)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
from heapq import heappush, heappop

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math
n = int(input())
def max_digit(p,q):
    p_i = 0
    q_i = 0
    while p+q != 0:
        if p: 
            p //= 10
            p_i +=  1
        if q:
            q //= 10
            q_i += 1
    return max(p_i,q_i)
for i in range(math.ceil(n**(1/2)),0,-1):
    if n % i == 0:
        print(max_digit(i,n//i))
        exit()

Submission status: Accepted

Solution code:

import math
N = int(input())

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

ans = float("inf")
for (a, b) in T:
  a = len(str(a))
  b = len(str(b))
  ans = min(ans, max(a, b))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = 10

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    def f(a,b):return max(len(str(a)),len(str(b)))
    n=II()
    if n==1:
        print(1)
        exit()
    ans=100
    for d in range(1,n):
        if d**2>n:break
        if n%d==0:
            ans=min(ans,f(d,n//d))
    print(ans)

main()

Submission status: Accepted

Solution code:
N = int(input())
import math
n = math.floor(N**0.5)
for i in range(n):
    x = n - i
    if N % x == 0:
        y = N//x
        break
print(len(str(y)))

Submission status: Accepted

Solution code:
import math

if __name__ == '__main__':

	#入力
	N = int(input())
	ans = 11

	ref = int(math.sqrt(N)) + 1

	for i in range(1,ref):
		if N % (ref - i) == 0:
			bigger_one = max(i, int(N/(ref-i)))
			keta = int(math.log10(bigger_one)) + 1
			ans = keta
			break

	print(ans)

Submission status: Accepted

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


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


ans = 10 ** 10
for i in range(1, int(sqrt(n)) + 1):
    if n % i != 0:
        continue
    j = n // i
    ans = min(ans, calc_f(i, j))

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

cList = []
for i in range(1,n):
  cal = n//i
  if i > cal:
    break
  if n % i == 0:
    cList.append([i,cal])

sL = n
for i in range(len(cList)):
  sT = max(len(str(cList[i][0])),len(str(cList[i][1])))
  if sL > sT:
    sL = sT

print(sL)

Submission status: Accepted

Solution code:
import math
n = int(input())
s = int(math.sqrt(n))+1
m = len(str(n))

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

Submission status: Accepted

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


ans = 10**9

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

print(ans)

Submission status: Accepted

Solution code:
import sys
import numpy as np

# N 対象の整数
n = int(input())

# N の平方根
n_sqrt = np.sqrt(n)

# 約数を求める
divisors_a = []
divisors_b = []
for i in np.arange(1, n_sqrt + 1):
    if n % i == 0:
        # 約数
        divisors_a.append(int(i))
        divisors_b.append(int(n / i))

# divisors_b の一番最後の要素が桁数が小さい
print(len(str(divisors_b[-1])))

Submission status: Accepted

Solution code:
# coding: utf-8
def divisor(N):
    # 約数列挙
    divs = []
    for i in range(1, int(N**0.5)+1):
        if N % i == 0:
            divs.append(i)
            divs.append(N//i)
    return divs
def f(a, b):
    return max(len(str(a)), len(str(b)))

N = int(input())
divs = divisor(N)
ans = float("inf")
for i in range(0, len(divs), 2):
    a, b = divs[i], divs[i+1]
    ans = min(ans, f(a, b))
print(ans)

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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

    divs = make_divisors(N)
    ans = float("inf")
    for d in divs:
        ans = min(ans, max(len(str(N // d)), len(str(d))))

    print(ans)

    

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

use_clipboard=True
bbn=1000000007
	
#+++++

def gf(v):
	if v == 0:
		return 0
	return len(str(v))
		
def main():
	a = int(input())
	ret=0
	for i in range(1, int((a**0.5)+1)):
		if a % i == 0:
			ret = gf(a//i)

	print(ret)
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)
		
class input_clipboard:
	def __init__(self,s):
		self.input_l=s.splitlines()
		self.ii=0
		
	def input(self):
		ret = self.input_l[self.ii]
		self.ii+=1
		return ret

if __name__ == "__main__":
	if sys.platform =='ios':
		if use_clipboard:
			import clipboard
			input_text=clipboard.get()
			ic=input_clipboard(input_text)
			input = lambda : ic.input()
		else:
			sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

Solution code:
# coding: utf-8
def divisor(N):
    # 約数列挙
    divs = []
    for i in range(1, int(N**0.5)+1):
        if N % i == 0:
            divs.append(i)
            divs.append(N//i)
    return divs
def F(a, b):
    return max(len(str(a)), len(str(b)))
N = int(input())
divs = divisor(N)
ans = 10**9
for i in range(len(divs)//2):
    a, b = divs[2*i], divs[2*i+1]
    ans = min(ans, F(a,b))
print(ans)

Submission status: Accepted

Solution code:
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
    

N=int(input())
d=make_divisors(N)
#print(d)
L=len(d)

if L%2==1:
    index=L//2+1
    m=d[index-1]
    sm=str(m)
    print(len(sm))
else:
    index1=L//2
    index2=L//2+1
    m1=d[index1-1]
    m2=d[index2-1]
    sm1=str(m1)
    sm2=str(m2)
    print(max(len(sm1),len(sm2)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def d(n):
  return len(str(n))

N=int(input())
if N==1:
  print(1)
else:
  i=0
  #print(int(N**0.5))
  while N%(int(N**0.5)-i)!=0:
    i=i+1
  print(max(d(int(N**0.5)-i),d(N//(int(N**0.5)-i))))

Submission status: Accepted

Solution code:
import math
N = int(input())
res = []
M = int(math.sqrt(N))

for i in range(1, M + 1):
    if N % i == 0:
        A = int(i)
        B = int(N / i)

        res.append(max([len(str(A)), len(str(B))]))

print(min(res))

Submission status: Accepted

Solution code:
import math

N = int(input())

a = math.ceil(N ** (1/2))

for i in range(a):
  if int(N % (a-i)) == 0:
    aa = len(list(str(int(a-i))))
    bb = len(list(str(int(N // (a-i)))))
    break

print(max(aa,bb))

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
N = 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
div = make_divisors(N)
ans = 10 ** 10
import bisect
idx = bisect.bisect(div, N ** (1 / 2))
loop = [idx-1, idx, idx+1]
can = []
for i in loop:
    if 0 <= i < len(div):
        can.append((div[i], N // div[i]))
for j in can:
    left, right = j
    ans = min(ans, max(len(str(left)), len(str(right))))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 100000000
i = 1
table = []
while i * i <= N:
  if N%i == 0:
    x = max([len(str(i)), len(str(N//i))])
    if x < ans:
      ans = x
  i += 1
  
print(x)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
 
import math
import itertools
import sys
import copy
 
# 入力
#A, B, C, D = map(int, input().split())
#L = list(map(int, input().split()))
#S = list(str(input()))
N = int(input())
#S = str(input())

i = 1
minNum = sys.maxsize
while i <= N**0.5 :
  if N % i == 0 :
    minNum = min(minNum, max(len(str(i)), len(str(N//i))))
  i += 1
print (minNum)

Submission status: Accepted

Solution code:
n = int(input())
tmp = n
for x in range(1, n+1):
    y = n//x
    if x > y:
        break
    if n % x == 0:
        tmp = y
ans = len(str(tmp))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

def F(A, B):
    if len(str(A)) > len(str(B)):
        return len(str(A))
    else:
        return len(str(B))
ans = float('inf')

for a in range(1,int(n**.5)+1):
    if n%a==0:
        b = n // a
        tmp = F(a, b)
        if ans > tmp:
            ans = tmp
print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 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 S(): return input()

def factor(n):
    rt_n = int(math.sqrt(n)) + 2
    for i in range(1, rt_n):
        if n % i == 0:
            yield (i, n//i)

def main():
    N = I()
    ans = inf
    for s1, s2 in factor(N):
        f = max(len(str(s1)), len(str(s2)))
        ans = min(ans, f)
    print(ans)



main()

Submission status: Accepted

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


n = int(input())
d = make_divisors(n)[-1]
print(len(str(max(d[0], d[1]))))

Submission status: Accepted

Solution code:
n = int(input())

m = n ** 0.5

if (m.is_integer()):
   print(len(str(int(m))))
else:
   m = int(m)
   for i in reversed(range(1, m)):
      if (n % i == 0):
         print(len(str(int(n/i))))
         exit()

Submission status: Accepted

Solution code:
N = int(input())

# F(A, B)を定義する
def F(A, B):
    A = str(A)
    B = str(B)
    if len(A) >= len(B):
        return len(A)
    else:
        return len(B)

minimumList = []
for a in range(1, int(N**0.5) + 1):
    if N % a == 0:
        b = N // a  # 商
        minimumList.append(F(a, b))
print(min(minimumList))

Submission status: Accepted

Solution code:
N = int(input())

# F(A, B)を定義する
def F(A, B):
    A = str(A)
    B = str(B)
    if len(A) >= len(B):
        return len(A)
    else:
        return len(B)

minimumList = []
for a in range(1, int(N**0.5) + 1):
    if N % a == 0:
        b = N // a
        minimumList.append(F(a, b))
print(min(minimumList))

Submission status: Accepted

Solution code:
N = int(input())
A = [[1, N]]
p = 2
dig = 10
while p <= int(N**(1/2)):
  if N % p == 0:
    A.append([p, N//p])
  p += 1
B = max(A)
print(len(str(max(B))))

Submission status: Accepted

Solution code:
n  = int(input())

count = float("inf")
for i in range(1, int(n ** 0.5 + 1)):
    if n // i == n / i:
        temp = max(len(str(i)), len(str(n//i)))
        count = min(count, temp)
        
print(count)

Submission status: Accepted

Solution code:
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

N = int(input())
list =  make_divisors(N)
ans = 10**9
if len(list)%2==1:
    list.append(list[-1])
for i in range(0,len(list),2):
    tmp1 = len(str(list[i]))
    tmp2 = len(str(list[i+1]))
    ans = min(ans,max(tmp1,tmp2))
print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
def divisor(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

n=int(input())

s=divisor(n)
from bisect import bisect_left as bl
a=bl(s,n**0.5)
print(len(str(s[a])))

Submission status: Accepted

Solution code:
# 約数
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)

    return divisors

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

n = int(input())
divisors = make_divisors(n)
ans = float('INF')
#print(divisors)
for i in divisors:
    tmp = f(i, n//i)
    if tmp < ans:
        ans = tmp
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def make_divisors(n):
    import math
    divisors = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0: #割り切れるとき
            divisors.append(i)
            if i != n//i:
                divisors.append(n//i)
    divisors.sort()
    return divisors

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


lst = make_divisors(N)

ans = 10 ** 18
for a in lst:
    b = N // a
    ans = min(ans, F(a, b))

print (ans)

Submission status: Accepted

Solution code:
n = int(input())

ans = float("inf")
for a in range(1, int(n ** 0.5) + 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:
N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

f = []
for a in range(1, int(n ** 0.5) + 1):
    if n % a == 0:
        f.append(len(str(max(a, n // a))))
else:
    print(min(f))

Submission status: Accepted

Solution code:
import math

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

for a in range(math.floor(math.sqrt(N)) + 1):
  if a == 0:
    continue
  
  if N % a == 0:
    b = math.floor(N / a)
    li.append([a, b])

ans = 100000000000000000000000000

for i in li:
  if len(str(i[0])) >= len(str(i[1])):
    k = len(str(i[0]))
  else:
    k = len(str(i[1]))

  if ans > k:
    ans = k

print(ans)