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:
def F(a, b):
    # def _(n):
    #     c = 0
    #     while n:
    #         n //= 10
    #         c += 1
    #     return c

    # return _(max(a, b))
    return len(str(max(a, b)))


N = int(input())
ans = float('inf')
n = int(N**0.5) + 1
for a in range(1, n):
    b = N // a
    if b != N / a:
        continue
    ans = min(ans, F(a, b))
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
def F(a, b):
    def _(n):
        c = 0
        while n:
            n //= 10
            c += 1
        return c

    return _(max(a, b))


N = int(input())
ans = float('inf')
for a in range(1, N + 1):
    b = N // a
    if a > b:
        break
    if b != N / a:
        continue
    ans = min(ans, F(a, b))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

def Main(N):
    ans = 10
    i = 1
    while i*i <= N:
        if N%i == 0:
            ans = min(ans, max(len(str(i)), len(str(N//i))))
        i += 1
    return ans
    
print(Main(N))

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

d = make_divisors(N)

out = 10
t = 0
while t<=len(d)-1:
    A = N//d[t]
    B = N//A
    X = max(len(str(B)),len(str(A)))
    if X<out:
        out = X
    t+=2
print(out)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# from collections import defaultdict, deque
from math import log10, sqrt, ceil
def input(): return sys.stdin.readline()[:-1] # warning not \n
# def input(): return sys.stdin.buffer.readline()[:-1]

def c(x):
    cnt = 0
    n = x
    while n:
        n //= 10
        cnt += 1
    return cnt

def solve():
    n = int(input())
    o = n
    ans = c(n)
    for i in range(2, int(sqrt(n)) + 3):
        if (n % i == 0):
            a = i
            b = o // a
            ans = min(ans, max(c(a), c(b)))
        if i > n:
            break

    print(ans)
    
        




t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""
1 -> (1, 2) -> (2 ** 3, 3) -> (3, 1)
100000007
"""

Submission status: Accepted

Solution code:
n=int(input())

x=int(n**0.5)
for i in range(x,0,-1):
  if n%i==0:
    y=n//i
    print(len(str(y)))
    exit()

Submission status: Accepted

Solution code:
n=int(input())

ans=10**5
x=int(n**0.5)
for i in range(x,0,-1):
  if n%i==0:
    y=n//i
    ans=min(ans,len(str(y)))

print(ans)

Submission status: Accepted

Solution code:
from collections import Counter
from collections import deque
import math
import bisect
import sys
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))
 
def f(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())
l=f(n)
ans=10**10
for i in l:

    ans=min(ans,max(len(str(i)),len(str(n//i))))
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

d=divisore(n)

ans=10**9
for i in d:
  a=i
  b=n//a
  t_ans=max(len(str(a)),len(str(b)))
  ans=min(ans,t_ans)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

# 約数の全列挙
def divisors(n):
    divisors = []
    R = int(n**(0.5)) + 1
    for i in range(1, R):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    # divisors.sort(reverse=True)  # ソート
    return divisors

ans = len(str(N))
for a in divisors(N):
    b = N // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

def divisor(n): #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


d = divisor(n)

mn = 20
for i in d:
    if (n / i) % 1 == 0:
        mx = max(len(str(n // i)), len(str(i)))
        mn = min(mn, mx)

print(mn)

Submission status: Accepted

Solution code:
from math import ceil

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

n = int(input())
divs = divisors(n)
divs.sort()
lim = ceil(len(divs) / 2)
ans = 11

for i in range(lim):
    a = divs[i]
    b = divs[(-1) * (i + 1)]
    f = max(len(str(a)), len(str(b)))
    ans = min(ans, f)

print(ans)

Submission status: Accepted

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

    mn = float('inf')
    for A in range(int(sqrt(N))+1,0,-1):
        if N % A == 0:
            B = N // A
            mn = min(f(A,B), mn)

    print(mn)

def f(A,B):
    return max(len(str(A)), len(str(B)))
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
#import numpy as np
import math
from fractions import Fraction
import itertools

input=sys.stdin.readline
n=int(input())
m=math.ceil(pow(n,0.5))
for i in range(m):
    if n%(m-i)==0:
        p=m-i
        break
q=n//p
ans=int(max(p,q))
print(len(str(ans)))

Submission status: Accepted

Solution code:
N=int(input())
from math import sqrt
L=[]
for i in range(1,int(sqrt(N))+1):
    if N%i==0:
        L.append((i,N//i))
ans=float("INF")
for t in L:
    a,b=t
    now=max(len(str(a)), len(str(b)))
    ans=min(ans, now)

print(ans)
#print(L)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
t=[]
for i in range(1,int(n**0.5)+1):
  if n%i==0:
    t.append(i)
hantei=10**10+1
for i in range(len(t)):
  x=len(str(t[i]))
  y=len(str(n//t[i]))
  if hantei>max(x,y):
    hantei=max(x,y)
print(hantei)

Submission status: Accepted

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

from math import sqrt

def divisor_enumeration(n):
    div = []
    for i in range(1, int(sqrt(n))+1):
        if n % i == 0:
            if n // i != i:
                div.append((i, n // i))
            else:
                div.append((i, i))
        
    return div


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

    F = divisor_enumeration(N)

    ans = 10**15
    for a, b in F:
        a, b = len(str(a)), len(str(b))
        tmp = max(a, b)
        ans = min(ans, tmp)

    print(ans)
    

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())
sN = int(math.sqrt(N))
ans = int(1e11)

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


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

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

    res = f_inf
    for a in range(1, int(pow(n, 0.5)) + 1):
        if n % a == 0:
            b = n // a
            t = f(a, b)
            res = min(res, t)

    print(res)


if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

from math import sqrt

N = int(input())

if N == 1:
    print (1)
    exit()


def calc(tmp):
    return len(str(tmp))

ans = MOD
for i in range(1, int(sqrt(N)) + 10):
    if N % i == 0:
        ans = min(ans, max(calc(i), calc(N // i)))

print (ans)

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    base = n
    f = []
    i = 2
    while i * i <= n:
        if n % i == 0:
            f.append(i)
            if i * i != n:
                f.append(n // i)
        i += 1
    if n != 1:
        f.append(n)
    f.sort()
    answer = float("inf")
    for ff in f:
        answer = min(answer, max(len(str(ff)), len(str(base // ff))))
    if base == 1:
        answer = 1
    print(answer)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def factor(N):
    f = []
    for i in range(1,int(N**0.5)+1):
        if N%i == 0:
            f.append(i)
    return sorted(list(set(f)))

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

N = int(input())
m = 1e9
for n in factor(N):
    m = min(f(n,N//n),m)

print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())

from math import sqrt,floor

nn=floor(sqrt(n))

for i in reversed(range(1,nn+1)):
    if n%i==0:
        f=max(len(str(i)),len(str(int(n/i))))
        print(f)
        exit()

Submission status: Accepted

Solution code:
n=int(input())

from math import sqrt,floor

nn=floor(sqrt(n))

for i in reversed(range(1,nn+1)):
    if n%i==0:
        f=max(len(str(i)),len(str(int(n/i))))
        print(f)
        exit()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import math
N = int(input())

square_root = math.floor(math.sqrt(N))

for a in range(square_root, 0, -1):
    if N % a == 0:
        b = int(N / a)
        print(len(str(b)))
        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)

    # divisors.sort()
    return divisors


org = make_divisors(n)
div = sorted(org)

divNum = len(div)


if (divNum % 2 == 0):
    indA = int(divNum / 2) - 1
    indB = int(divNum / 2)
else:
    indA = int((divNum - 1) / 2)
    indB = indA

# print(div[indA])

A = len(str(div[indA]))
B = len(str(div[indB]))

ans = max(A, B)
print(ans)

Submission status: Accepted

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

N=int(input())
M=int(N**0.5)
v=100000
for i in range(1,M+1):
  if N%i==0:
    j=int(N/i)
    if v>F(i,j):
      v=F(i,j)
    

if v==100000:
  v=len(str(N))
print(v)

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())
div = make_divisors(n)

ans = float("inf")
for d in div:
    A = d
    B = n // d
    ans = min(ans, max(len(str(A)), len(str(B))))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
m = n * 1

if n == 1:
    print(1)
    exit()

sqr = int(n**0.5)
l1 = len(str(sqr))

pf = {}
for i in range(2, int(m**0.5) + 1):
    while not m % i:
        pf[i] = pf.get(i, 0) + 1
        m //= i
if m > 1:
    pf[m] = 1

ls = sorted(pf.items(), key=lambda x: x[0], reverse=True)
l2 = len(str(ls[0][0]))
other = n // ls[0][0]
l3 = len(str(other))

if l1 <= l2 < l3:
    print(l3)
else:
    print(max(l1, l2))

Submission status: Accepted

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


def read():
    N = int(input().strip())
    return N,


def solve(N):
    AB = []
    for a in range(1, N+1):
        if a * a > N:
            break
        if N % a == 0:
            b = N // a
            AB.append((a, b))
    minl = 100000000
    for a, b in AB:
        minl = min(minl, max(len(str(a)), len(str(b))))
    return minl


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

import math

end = int(math.sqrt(N))+1
ans = len(str(N))

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

Submission status: Accepted

Solution code:
def yaku(n):
    yalu_l = []
    for j in range(1, int(n ** 0.5) + 1):
        if n % j == 0:
            yalu_l.append([n // j, j])
        else:
            continue
    return yalu_l


ans = 10 ** 9

n = int(input())

for i in yaku(n):
    p = len(str(i[0]))
    q = len(str(i[1]))
    ans = min(max(p, q), ans)

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
n=int(input()) #　a1
comb=[]

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

ans=float('inf')

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


  ans=min(ans,pans)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def digit(n):
    l = len(str(n))
    return l

n = int(input())
mx = int(math.sqrt(n))
mi = 10 ** 8
for i in range(1, mx+1):
    if n % i == 0:
        a = digit(i)
        b = digit(int(n/i))
        mi = min(mi, max(a, b))
print(mi)

Submission status: Accepted

Solution code:
import math


def get_half_dividers(n):
    return {i for i in range(1, int(n ** 0.5) + 1) if n % i == 0}


def get_digit(n):
    return int(math.log10(n)) + 1


N = int(input())

half_dividers = get_half_dividers(N)
f_min = get_digit(N)

for d in half_dividers:
    e = N // d
    f = max(get_digit(d), get_digit(e))
    f_min = min(f_min, f)

print(f_min)

Submission status: Accepted

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

ini = 1 if n%2 else 2
div = []
for i in range(ini, int(math.sqrt(n)+1),2):
  if n%i==0:
    div.append([i,n//i])
print(max(len(str(div[-1][0])),len(str(div[-1][1]))))

Submission status: Accepted

Solution code:
import math
N = int(input())
#一番短くなるのは、a = b となるケース
#一番長くなるのは　b = 1ととなるケース
end = int(math.sqrt(N))+1
ans = len(str(N+1))

for b in range(1, end):
  if N % b == 0:
    a = N // b
    ans = min(ans, len(str(max(a,b))))
    #print(a,b, ans)
print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())#時間をoverするができないことはない。
minimum=len(str(n))
temp=minimum
for i in range(1,math.ceil(math.sqrt(n))+1):
    if n%i==0:
        a=i
        b=n//i
        temp=max(len(str(a)),len(str(b)))
        if minimum>=temp:
            minimum=temp
print(minimum)

Submission status: Accepted

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

    minRes = 10 ** 10

    for a in range(1, 10** 5 + 1):
        if n % a == 0:
            b = int(n / a)

            res = max(len(str(a)), len(str(b)))

            if res < minRes:
                minRes = res
    
    print(minRes)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def less_digits(A, B):
    return max(len(str(A)), len(str(B)))


N = int(input())
ans = float("inf")

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

print(ans)

Submission status: Accepted

Solution code:
import math

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

ans = 15

for i in range(1, rout + 1):
    if N % i == 0:
        A = i
        B = int(N / i)
        F = max(len(str(A)), len(str(B)))
        if ans >= F:
            ans = F

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

ans = 10000000007
divs = make_divisors(n)
#print(divs)
for i in range(len(divs)):
  a = divs[i]
  b = divs[-(i+1)]
  digit = f(a, b)
  # print('{} : {} : {}'.format(a, b, digit))
  ans = min(ans, digit)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from fractions import gcd
import sys
from math import sqrt
def main():
    input = sys.stdin.readline
    n = int(input())
    r = sqrt(n)
    r = str(r)
    r_i = r.split('.')
    inte = int(r_i[0])
    g_list = []
    for j in range(inte):
        g = gcd(inte-j, n)
        g_list.append(g)
    g_list.sort()
    min_g = g_list[-1]
    max_g = n / min_g
    max_g_list = list(str(int(max_g)))
    
    print(len(max_g_list))
    
    
        
        

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math
import copy
from queue import Queue
import heapq
import numpy as np

MOD = 5000000007

n = int(input())
#b = int(input())
#a, b, k = [int(i) for i in input().split()]
#table = [[int(i)  for i in input().split()] for j in range(m)]
#table = [list(input()) for n in range(r)] #table[h][w]
#p = [int(i) for i in input().split()]
#s = [int(i) for i in range(n)]
#p = [int(input()) for i in range(m)]
#s = input()

#list = list(s)
#dp = [MOD for _ in range(m)]
#dp = [[0 for _ in range(n+1)] for _ in range(n+1)]
#dp = [[[0 for _ in range(11)] for _ in range(2)] for _ in range(11)]

#Combination = [[0 for _ in range(n+1)] for _ in range(n+1)]
#b = [[0 for _ in range(n+1)] for _ in range(n+1)]

i = int(math.floor(math.sqrt(n)))
a = 0
b = 0
while(i > 0):
    if(n % i == 0):
        a = int(math.floor(math.log(i,10)))+1
        b = int(math.floor(math.log(n // i,10)))+1
        break
    i = i - 1

if(a > b) :
    print(a)
else:
    print(b)

Submission status: Accepted

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

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

print(len(str(min(lis))))

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
min_keta = 10 ** 6


def get_keta(var):
    ans = 0
    while True:
        var = var // 10
        ans += 1
        if var == 0:
            break
    return ans


for a in range(1, int(np.sqrt(N)) + 1):
    if N % a == 0:
        tmp_keta = get_keta(max(a, N // a))
        if tmp_keta < min_keta:
            min_keta = tmp_keta
print(min_keta)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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

Submission status: Accepted

Solution code:
n=int(input())


yakusu=[]
for i in range(1,-int(-n**0.5)+1):
    if n%i==0:
        yakusu.append((i,n//i))

print( max( len(str(yakusu[-1][0])),len(str(yakusu[-1][1])) ) )

Submission status: Accepted

Solution code:
def resolve():
    # 整数 1 つ
    n = int(input())
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    import math
    fmin = 10 ** 10
    for i in range(1, math.ceil(math.sqrt(n))+1):
        if n % i == 0:
            b = int(n / i)
            if fmin > max(len(str(i)), len(str(b))):
                fmin = max(len(str(i)), len(str(b)))

    print(fmin)


resolve()

Submission status: Accepted

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

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

f = lambda a, b: max(len(str(a)), len(str(b)))
divisors = make_divisors(N)
ans = float("inf")
for d in divisors:
    ans = min(ans, f(d, N // d))
print(ans)

Submission status: Accepted

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

m=int(np.sqrt(n))+1

def f(i,j):
    return max(math.log10(i)+1,math.log10(j)+1)

ans=10**6
for i in range(m):
    a=i+1
    if n%a==0:
        b=int(n/a)
        ans=min(ans,int(f(a,b)))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

y = int(N/x[-1])
print(len(str(y)))

Submission status: Accepted

Solution code:
import numpy as np
def main():
  N = int(input())
  ans = 30
  for i in range(1, int(np.sqrt(N))+2):
    if N % i == 0:
      ans = min(ans, max(len(str(i)), len(str(N//i))))
  print(ans)
if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
n = int(input())
a = 1
b = 1
mx = 10 ** 10
while (a <= b and a * a <= n):
    if n % a == 0:
        b = int(n / a)
        mx = min(mx, max(a, b))
    a += 1
print(len(str(mx)))

Submission status: Accepted

Solution code:
n = int(input())
a = 1
b = 1
mx = 10 ** 10
while (a <= b and a <= 10**5):
    if n % a == 0:
        b = int(n / a)
        mx = min(mx, max(a, b))
    a += 1
print(len(str(mx)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

ans1 = 0

A = '1'
B = str(N)

if len(A)>=len(B):
    ans = len(A)
else:
    ans = len(B)
    
for i in range(2,int(math.sqrt(N)+1)):
    A = i
    if N%A==0:
        B = int(N / A)
        A = str(A)
        B = str(B)
#        print(A, B)
        if len(A)>=len(B):
            ans1 = len(A)
        else:
            ans1 = len(B)
        if ans1 <= ans:
            ans = ans1
    if len(str(A))==len(str(B)):
        break
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)
    return divisors

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

def main():
    N = int(input())
    dvs = make_divisors(N)
    flag = False
    if len(dvs)%2 != 0:
        flag = True
        ldvs = dvs.pop()
    ans = float('inf')
    for i in range(len(dvs)//2):
        ans = min(ans, F(dvs[2*i], dvs[2*i+1]))
    if flag:
        ans = min(ans, len(str(ldvs)))
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())

INF = 10**11
ans = INF

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

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())

INF = 10**11
ans = INF

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

ans = 1000000000
half = int((N+1)**(1/2) + 1)
for A in range(1, half):
    if N%A == 0:
        B = int(N / A)
        if F(A, B) < ans:
            ans = F(A, B)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
n = 10
for A in range(1, 100001):
    if N % A != 0:
        continue
    B = int(N / A)
    a = len(str(A))
    b = len(str(B))
    m = max(a, b)
    n = min(n, m)
print(n)

Submission status: Accepted

Solution code:
n=int(input())
import math 
lim=math.floor(n**(1/2))
ans=1000000000
for i in range (1,lim+1):
  if n%i==0:
    a=len(str(int(n/i)))
    b=len(str(int(i)))
    f=max(a,b)
    ans=min(f,ans)
    
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
for i in range(int(n**0.5)+1, 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())
ans = float("inf")
c = 1
while c <= int(N**(1/2)//1):
  if N%c == 0:
    ans = min(ans,max(len(str(c)),len(str(N//c))))
  c += 1  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = float('inf')
temp = 0
for i in range(int(n**(1/2)), 0, -1):
    if n%i == 0:
        temp = max(i, n//i)
        ans = min(temp, ans)
print(len(str(ans)))

Submission status: Accepted

Solution code:
n = int(input())
def f(a, b):
  return max(map(len, map(str, (a, b))))

a, b = 1, n
for i in range(2, int(n**0.5) + 1):
  q, r = divmod(n, i)
  if r == 0:
    a, b = i, q
print(f(a, b))

Submission status: Accepted

Solution code:
from math import sqrt
def F(A,B):
    A=len(str(A))
    B=len(str(B))-2
    return A if A>B else B
n=int(input())
o=[]
for a in range(1,int(sqrt(n))+1):
    b=n/a
    if b.is_integer():
        o.append(F(a,b))
print(o[-1])

Submission status: Accepted

Solution code:
n = int(input())

import math
m = math.floor(n**0.5)

for i in range(m,0,-1):
    if n % i ==0:
        ii = math.floor(math.log(i,10))+1
        ij = math.floor(math.log(n//i,10))+1
        print(max(ii,ij))
        exit()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    m = 1
    k = int(n ** 0.5)

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    m = 1
    k = int(n ** 0.5)

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

    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    ans = solve(n)
    print(ans)

def F(a, b):
    #print(f'{a = } {b = }')
    return max(len(str(a)), len(str(b)))

def solve(n):
    for a in range(int(n ** (1 / 2)), 0, -1):
        if n % a == 0:
            return F(a, n // a)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math
N = int(input())
a_a = 0
b_b = 0
def F_ab(a, b):
    a_len = len(str(a))
    b_len = len(str(b))
    
    if(a_len >= b_len):
        return a_len
    else:
        return b_len
    
n = math.floor(N ** (1/2))

min_f = 99999999999999
for a in range(1, n + 1):
    if(N % a == 0):
        b = math.floor(N/a)
        f = F_ab(a, b)
        if(min_f > f):
            min_f = f
            a_a = a
            b_b = b
        
print(min_f)

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())
res = 100
for x in make_divisors(n):
    y = n // x
    res = min(res, max(len(str(x)), len(str(y))))
print(res)

Submission status: Accepted

Solution code:
import math
 
N=int(input())
 
a=math.floor(math.sqrt(N))
 
for i in range(a,0,-1):
  if N%i==0:
    r=N//i
    print(max(len(str(i)),len(str(r))))
    exit()

print(len(str(N)))

Submission status: Accepted

Solution code:
import math
N = int(input())
res = float('Inf')
M = int(math.sqrt(N))
for A in range(1, M+1):
    if N % A == 0:
        B = int(N / A)
        a = len(str(A))
        b = len(str(B))
        c = max(a, b)
        if res > c:
            res = c
print(res)

Submission status: Accepted

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

for x in range(1,int(N**0.5)+1):
    if N%x==0:
        if len(str(N//x))<ans:
          ans=len(str(N//x))
          
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

yakusu = []
ans = 10**15 

for x in range(1,int(n**0.5)+1):
    if(n % x == 0):
        yakusu.append(x)
        if (x != n // x):
            yakusu.append(n // x)
yakusu.sort()

for x in yakusu:
    if(ans > len(str(max(x,n // x)))):
        ans = len(str(max(x,n // x)))
print(ans)