Problem:


Score : 300 points

Problem Statement

You are given an integer N.

For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.

For example, F(3,11) = 2 since 3 has one digit and 11 has two digits.

Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B.

Constraints

1 \leq N \leq 10^{10}

N is an integer.

Input

The input is given from Standard Input in the following format:

N

Output

Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B.

Sample Input 1

10000

Sample Output 1

3

F(A,B) has a minimum value of 3 at (A,B)=(100,100).

Sample Input 2

1000003

Sample Output 2

7

There are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.

Sample Input 3

9876543210

Sample Output 3

6



Sample input:
10000


Sample output:
3

Submission status: Accepted

Solution code:
import math
inp = int(input())
searchMax = int(math.sqrt(inp))
min = 100
for i in range(1, searchMax + 1, 1):
    if inp % i == 0:
        maxLen = len(str(i)) if len(str(i)) > len(str(int(inp / i))) else len(str(int(inp / i)))
        min = min if min < maxLen else maxLen
print(min)

Submission status: Accepted

Solution code:
def list_divisor(x):
    res = []
    i = 1

    while i ** 2 <= x:
        if x % i == 0:
            res.append(i)
            if i ** 2 != x:
                res.append(x // i)

        i += 1

    return res

def resolve():
    n = int(input())
    divisors = sorted(list_divisor(n))

    l = len(divisors)
    if l % 2 == 0:
        print(max(len(str(divisors[l // 2 - 1])), len(str(divisors[l // 2]))))

    else:
        print(len(str(divisors[l // 2])))
        
resolve()

Submission status: Accepted

Solution code:
def enum_divisors(N):
    # 約数列挙
    import math as m
    a = set()
    for i in range(1, int(m.sqrt(N)) + 1):
        if N % i == 0:
            a.add(i)
            a.add(N // i)
    a = list(a)
    a.sort()
    return a


def resolve():
    N = int(input())
    a = enum_divisors(N)
    print(len(str(a[len(a) // 2])))


resolve()

Submission status: Accepted

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

Submission status: Accepted

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

print(f_min)

Submission status: Accepted

Solution code:
import math
n = int(input())
a = int(math.sqrt(n))
b = n
while a >= 1:
    if n % a == 0:
        b = n // a
        break
    else:
        a-=1
a = len(str(a))
b = len(str(b))
print(max(a,b))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 57 C
n = int(input())
def divisor(n):
    div_list = []
    for i in range(1, int(1+ n**0.5)):
        if n%i == 0 and i**2 == n:
            div_list.append(i)
        elif n%i == 0:
            div_list.append(i)
            div_list.append(int(n/i))
    return div_list
ln = sorted(divisor(n))
#print(len(str(ln[-1*int(len(ln)/2)])))
a = 12
for i in range(len(ln)):
    if a > max(len(str(ln[i])), len(str(ln[-i-1]))):
        a = max(len(str(ln[i])), len(str(ln[-i-1])))
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def get_digit(n): #桁数を求める関数
    return len(str(n))

def func(n):
    a = 1
    res = float('inf')
    while a**2 <= n:
        if n % a == 0:
            b = n // a
            res = min(res, max(get_digit(a), get_digit(b)))

        a += 1
    return res    

n = int(input())
print(func(n))

Submission status: Accepted

Solution code:
n = int(input())
ans = 11
for i in range(1,n+1):
    if i*i > n:
        break
    else:
        if n % i != 0:
            continue
        else:
            a = i
            b = n//i
            tmp = max(len(str(a)),len(str(b)))
            ans = min(ans,tmp)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
def main(n):
    i = 1
    ans = len(str(n))
    while i**2 <= n:
        if n % i == 0:
            ans = min(ans, len(str(max(i, int(n/i)))))
        i += 1
    print(ans)

main(n)

Submission status: Accepted

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

print(len(str(n//maxi)))

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())
p = make_divisors(n)
ans = 1000000

for i in range((len(p)+1)//2):
    x = p[i]
    y = p[-1-i]
    z = max(len(str(x)),len(str(y)))
    if z < ans:
        ans = z

print(ans)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sun May 31 17:19:32 2020

@author: NEC-PCuser
"""

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            while temp%i==0:
                temp //= i
                arr.append(i)

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

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

    return arr

def multiplication(n):
    ans = len(str(n))
    for i in range(2, int(-(-n**0.5//1))+1):
        if (n % i == 0):
            ans = max([len(str(i)), len(str(n // i))])
    return ans
        

if __name__ == "__main__":
    N = int(input())
    """
    l = factorization(N)
    """
    print(multiplication(N))
    """
    minimu = 10 ** 10
    ans = 0
    for i in range(0, 2**len(l)):
        a = 1
        b = 1
        for j in range(0, len(l)):
            if ((i >> j) & 1):
                a *= l[j]
            else:
                b *= l[j]
        if (abs(a - b) < minimu):
            minimu = abs(a - b)
            ans = max([len(str(a)), len(str(b))])
    print(ans)
    """

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
b = n
for i in range(1, n + 1):
  if i * i > n:
    break
  if n % i == 0:
    b = n // i
ans = 0
while b > 0:
  b //= 10
  ans += 1
print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
ans = float('inf')
for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0:
        j = n//i
        ans = min(ans, len(str(j)))
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())
l = make_divisors(n)
print(len(str(max(l[len(l) // 2], l[len(l) - len(l) // 2 - 1]))))

Submission status: Accepted

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

        #divisors.sort()
        return divisors

from sys import stdin
def main():
    #入力
    readline=stdin.readline
    n=int(readline())
    ds=make_divisors(n)

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

    print(ans)
    
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
import math

__DEUBG__ = 1
N = int(input())

def factor(num):
    for i in range(1, 1+int(math.sqrt(num))):
        q, r = divmod(num, i)
        if r == 0:
            yield i, q

minimum = N
for pair in factor(N):
    tmp = max(map(lambda x:len(str(x)), pair))
    if tmp < minimum:
        minimum = tmp

print(minimum)

Submission status: Accepted

Solution code:
#dpでできないかな？
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

#約数列挙
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=I()
ans=inf
for i in make_divisors(n):
    u=n//i
    val=max(len(str(u)),len(str(i)))
    ans=min(ans,val)
print(ans)

Submission status: Accepted

Solution code:
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()

from collections import defaultdict, deque, Counter
from sys import exit
import heapq
import math
from fractions import gcd
import copy
from itertools import permutations
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

from itertools import permutations
from math import factorial, hypot

#############
# Main Code #
#############

N = getN()

ans = []
sq = math.floor(math.sqrt(N))
for i in range(sq, 0, -1):
    if N % i == 0:
        ans = [i, N // i]
        break
print(max(len(str(ans[0])), len(str(ans[1]))))

Submission status: Accepted

Solution code:
def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            ass.append(n//i)
    return ass #sortされていない

# テスト
N = int(input())
#print(divisor(N))
div = divisor(N)
ans = 0
for a in div:
    b = N // a
    A = str(a)
    B = str(b)
    ans = max(len(A),len(B))
print(ans)

Submission status: Accepted

Solution code:
def div(n):
    # divisors whose values are not more than sqrt(n) 
    ret = list()
    a = 1
    while a ** 2 <= n:
        if n % a == 0:
            ret.append(a)
        a += 1
    return ret


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


def main():
    N = int(input())
    ans = len(str(N))
    for d in div(N):
        ans = min([ans, f(d, N // d)])
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = len(str(max(num, n // num)))
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)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]


li = make_divisors(n)

ans = float("inf")

for i in li:
    x = n // i
    ans = min(ans, max(len(str(i)), len(str(x))))

print(ans)

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 6)
# input = sys.stdin.readline    ####
def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product
from heapq import heapify, heappop, heappush


def solve():
    n = II()

    fact = []
    for i in range(1, int(pow(n, 0.5))+1):
        if n % i == 0:
            fact.append((i, n//i))
    # print(fact)

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

    ans = INF
    for (x, y) in fact:
        ans = min(ans, f(x, y))
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#4問目
import math
N = int(input())
yakusuu = []
#約数列挙して桁数が小さいやつを抜き出せばOK
for i in range(1, math.ceil(N ** (1/2))+1):
    if N % i == 0:
        yakusuu.append([i, int(N/i)])
keta1 = 0
keta2 = 10 ** 10
for i in yakusuu:
    if len(str(i[0])) >= keta1 and len(str(i[1])) <= keta2:
        keta1 = len(str(i[0]))
        keta2 = len(str(i[1]))
print(max(keta1, keta2))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = 0
B = 0
num = 0
ans = 10**10

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

Submission status: Accepted

Solution code:
import math

N = int(input())
n = 1
divisor = []

while n*n<= N:
  if(N % n == 0):
    divisor.append(n)
  n+= 1
  
max_divisor = divisor[-1]

print(len(str(N// max_divisor)))

Submission status: Accepted

Solution code:
import math

n = int(input())
res = None
for i in range(1, int(math.sqrt(n))+2):
  if n % i == 0:
    if res is None:
      res = max(len(str(i)), len(str(n//i)))
    elif max(len(str(i)), len(str(n//i))) < res:
      res = max(len(str(i)), len(str(n//i)))
print(res)

Submission status: Accepted

Solution code:
def main():
    from math import floor, log10

    N = int(input())

    def G(x):
        return floor(log10(x)) + 1

    def F(a, b):
        return max(map(G, (a, b)))

    st = [F(1, N)]
    d = 2
    while d * d <= N:
        if N % d == 0:
            st.append(F(d, N // d))  # (d, N // d)
        d += 1

    print(min(st))


if __name__ == '__main__':
    main()

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
m = 10**100
for v in make_divisors(N):
    A = v
    B = N // v
    m = min(m, max(len(str(A)), len(str(B))))

print(m)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
sq = int(n**0.5)

ans = 11
for i in range(1, sq+1):
    if n % i == 0:
        j = n // i
        ans = min(ans, max(len(str(i)), len(str(j))))
        
print(ans)

Submission status: Accepted

Solution code:
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())

    ans = 100
    for i in range(1, N+1):
        if N % i == 0:
            ans = min(ans, max(len(str(i)), len(str(N//i))))
        if i*i >= N:
            break
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = N

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
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())
A = make_divisors(N)
print(len(str(A[-1])))

Submission status: Accepted

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

import sys
# import time
import math
# import numpy as np
# import scipy.sparse.csgraph as cs            # csgraph_from_dense(ndarray, null_value=inf), bellman_ford(G, return_predecessors=True), dijkstra, floyd_warshall
# import random                                # random, uniform, randint, randrange, shuffle, sample
# import string                                # ascii_lowercase, ascii_uppercase, ascii_letters, digits, hexdigits
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from datetime import date, datetime          # date.today(), date(year,month,day) => date obj; datetime.now(), datetime(year,month,day,hour,second,microsecond) => datetime obj; subtraction => timedelta obj
# from datetime.datetime import strptime       # strptime('2019/01/01 10:05:20', '%Y/%m/%d/ %H:%M:%S') returns datetime obj
# from datetime import timedelta               # td.days, td.seconds, td.microseconds, td.total_seconds(). abs function is also available.
# from copy import copy, deepcopy              # use deepcopy to copy multi-dimentional matrix without reference
# from functools import reduce                 # reduce(f, iter[, init])
# from functools import lru_cache              # @lrucache ...arguments of functions should be able to be keys of dict (e.g. list is not allowed)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import count, cycle, repeat   # count(start[,step]), cycle(iter), repeat(elm[,n])
# from itertools import groupby                # [(k, list(g)) for k, g in groupby('000112')] returns [('0',['0','0','0']), ('1',['1','1']), ('2',['2'])]
# from itertools import starmap                # starmap(pow, [[2,5], [3,2]]) returns [32, 9]
# from itertools import product, permutations  # product(iter, repeat=n), permutations(iter[,r])
# from itertools import combinations, combinations_with_replacement
# from itertools import accumulate             # accumulate(iter[, f])
# from operator import itemgetter              # itemgetter(1), itemgetter('key')
# from fractions import gcd                    # for Python 3.4 (previous contest @AtCoder)



def main():
    mod = 1000000007                # 10^9+7
    inf = float('inf')              # sys.float_info.max = 1.79...e+308
    # inf = 2 ** 64 - 1             # (for fast JIT compile in PyPy) 1.84...e+19
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n = ii()
    small_divisor = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            small_divisor.append(i)
    
    assert(n % small_divisor[-1] == 0)
    a, b = small_divisor[-1], n // small_divisor[-1]
    print(max(len(str(a)), len(str(b))))



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import math

def f(A, B):
    digit_A = len(str(A))
    digit_B = len(str(B))

    return max(digit_A, digit_B)

n = int(input())

ans = 99999

for i in range(1, math.floor(math.sqrt(n)) + 1):
    if n % i != 0:
        continue
    A = i
    B = n // i
    ans = min(ans, f(A, B))

print(ans)

Submission status: Accepted

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
#from math import gcd
import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]

######OUTPUT######
def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()

#####Shorten#####
def DD(arg): return defaultdict(arg)


#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
  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
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr

#####MakeDivisors######
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

#####GCD#####
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#####BitCount#####
def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count

#####ChangeBase#####
def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))

#####IntLog#####
def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count

#############
# Main Code #
#############

N = I()
d = make_divisors(N)

MIN = INF

for i in d:
  MIN = min(MIN,max(len(str(i)),len(str(N//i))))
print(MIN)

Submission status: Accepted

Solution code:
import math

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

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

        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

ans = float('inf')
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())
sqrt_N = int(N**0.5)
ans = 10**18

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
limit = int(n ** 0.5 + 1)

ans = 10 ** 10
for i in range(1, limit):
    if n % i == 0:
        f = max(len(str(i)), len(str(n // i)))
        ans = min(ans, f)

print(ans)

Submission status: Accepted

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


n = int(input())

i = 1
ans = 11
while i * i <= n:
    if n % i == 0:
        temp = max(count_digit(i), count_digit(n // i))
        if ans > temp:
            ans = temp
    i += 1
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

def divisor(n):
    for i in reversed(range(1, int(np.sqrt(n)) + 1)):
        if n % i == 0:
            return i


n = int(input())
small = divisor(n)
big = n // small

print(len(str(big)))

Submission status: Accepted

Solution code:
n = int(input())
INF = 10**18
ans = INF


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


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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
INF = 10**18
ans = INF


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


for i in range(1, int(n**.5)+1):
    if n % i == 0:
        x = F(i, n//i)
        if x < ans:
            ans = x
print(ans)

Submission status: Accepted

Solution code:
#C
import math
n = int(input())
m = math.floor(n**(1/2))
ans = 11
for a in range(1,m+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:
from math import ceil, log10, sqrt

n = int(input())
ans = 0
for i in range(1, ceil(sqrt(n))+1)[::-1]:
    if n % i == 0:
        a = i
        b = n//i
        ans = max(len(str(a)), len(str(b)))
        break
print(ans)

Submission status: Accepted

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


n = int(input())
temp = -1
ans = 12
i = 1
while i * i <= n:
    if n % i == 0:
        temp = max(calc_digit(i), calc_digit(n // i))
    ans = min(temp,ans)
    i += 1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
i = 1
divisor = n ** 0.5
min_value = 10 ** 10 + 1
while i < divisor + 1:
    if n % i == 0:
        min_value = min(min_value,max(len(str(i)),len(str(n // i))))
    i += 1
print(min_value)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math

N = int(input())
def checklen(A, B):
    return max(len(str(A)), len(str(B)))

ans = float("inf")
M = round(math.sqrt(N))
for i in range(1, M+1):
    if N % i == 0:
        m = round(N/i)
        ans = min(checklen(i, m), ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# map(int, input().rstrip().split())

def VI(N, init=0):
  return [init for _ in range(N)]
def VVI(N, M, init=0):
  return [[init for _ in range(M)] for _ in range(N)]

def VD(N, init=0.0):
  return [init for _ in range(N)]
def VVD(N, M, init=0.0):
  return [[init for _ in range(M)] for _ in range(N)]

def Divisor(n):
  ret = []
  for i in range(1, n+1):
    if i*i > n:
      break
    else:
      if n % i == 0:
        ret.append(i)
        if i*i != n:
          ret.append(n//i)
  ret.sort()
  return ret

def digit(x):
  ret = 0
  while (x):
    x //= 10
    ret += 1
  return ret

N = int(input().rstrip())

divs = Divisor(N)

ans = int(1e18)
for div in divs:
  ddiv = N / div
  ans = min(ans, max(digit(div), digit(ddiv)))

print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input().rstrip())
sqrt_n = math.sqrt(n)
possible_a = math.ceil(sqrt_n)

def b(n,a):
    for i in range(a,0,-1):
        if n%i==0:
            return i,int(n/i) #a,b
            
def f(a,b):
    return max(len(str(a)),len(str(b)))

a,b = b(n,possible_a)
print(f(a,b))

Submission status: Accepted

Solution code:
import math


def f(a, b):
    keta_a = int(math.log10(a)) + 1
    keta_b = int(math.log10(b)) + 1
    return max(keta_a, keta_b)

n = int(input())
res = 0
for i in range(1, int(n ** 0.5) + 1):
    if (n % i == 0):
        res = i
print(f(res,n/res))