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):
  m = max(a,b)
  count=1
  while m//10!=0:
    count+=1
    m//=10
  return count

N = int(input())
tmp=F(1,N)
for i in range(round(N**0.5),1,-1):
  if N%i==0:
    if tmp>F(i,N//i):
      tmp = F(i,N//i)
      break
print(tmp)

Submission status: Accepted

Solution code:
def main():
    import sys
    import math
    import collections
    import itertools

    input = sys.stdin.readline().rstrip

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

    print(len(str(ans_ab[1])))
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
ni = lambda : int(ns())
na = lambda : list(map(int, stdin.readline().split()))

def main():
  n = ni()

  def divi(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

  def digitlen(n):
    return len(str(n))
  
  def f(a, b):
    x = digitlen(a)
    y = digitlen(b)
    if x >= y:
      return x
    else:
      return y

  if n == 1:
    print(1)
    return 

  ans = int(1e9+7)
  for e in divi(n):
    b = n // e
    ans = min(ans, f(e, b))
  print(ans)
  
main()

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    ml = 10 ** 10
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            s = str(i)
            t = str(n // i)
            ml = min(ml, max(len(s), len(t)))
    print(ml)


if __name__ == '__main__':
    slove()

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

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

def order_check(x):
  y = 1
  while x >= 10:
    x = x//10
    y +=1
  return y

Answer = N

for i in range(round(math.sqrt(N))):
  if N%(i+1) ==0:
    temp = max(order_check(i+1),order_check(N/(i+1)))
    if temp < Answer:
      Answer = temp

print(Answer)

Submission status: Accepted

Solution code:
N = int(input())
ylst = []
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        ylst.append(i)
        if i != N // i:
            ylst.append(N // i)

ans = 10 ** 11

for i in range(len(ylst)):
    for j in range(i, len(ylst)):
        if ylst[i] * ylst[j] == N:
            tmp = max(len(str(ylst[i])), len(str(ylst[j])))
            ans = min(ans, tmp)

print(ans)

Submission status: Accepted

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

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

    divs = trial_division()
    ans = 10**10 + 7
    for d in divs:
        d_other = N // d
        F = max(len(str(d)),len(str(d_other)))
        ans = min(ans,F)
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
ylst = []
for i in range(1, int(N ** 0.5) + 1):
    if N % i == 0:
        ylst.append(i)
        if i != N // i:
            ylst.append(N // i)

ans = 10 ** 11

for i in range(len(ylst)):
    for j in range(i, len(ylst)):
        if ylst[i] * ylst[j] == N:
            tmp = max(len(str(ylst[i])), len(str(ylst[j])))
            ans = min(ans, tmp)

print(ans)

Submission status: Accepted

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

result = 100
for i in range(1, sqrt_n + 1):
  if n % i == 0:
    digit = max(len(str(i)), len(str(n // i)))
    if digit < result:
      result = digit

print(result)

Submission status: Accepted

Solution code:
n=int(input())
s=int((n)**(1/2))+1
#print(s)

for i in range(s+1,0,-1):
    if n%i==0:
        l=i
        break
#print(l)
r=n//l
l=str(l)
r=str(r)
print(max(len(l),len(r)))

Submission status: Accepted

Solution code:
from math import sqrt


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


N = int(input())

for i in range(int(sqrt(N)), 0, -1):
    if N % i == 0:
        print(F(i, N // i))
        break

Submission status: Accepted

Solution code:
import math

n = int(input())
function = []
m = round(math.sqrt(n))

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

print(min(function))

Submission status: Accepted

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

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
    
ans = float("inf")
li = make_divisors(n)
if li[-1]**2 == n:
    li.append(li[-1])

for i in range(len(li))[::2]:
    ans = min(ans, max(len(str(li[i])), len(str(li[i+1]))))
print(ans)

Submission status: Accepted

Solution code:
N=int(input())
import math
def keta_count(x):
    count=0
    while x>0:
        x=x//10
        count+=1
    return count
    
a=1
ans=10000000000000
while a<=math.sqrt(N):
    b=N//a
    if a*b != N:
        a+=1
        continue
    _=max(keta_count(a),keta_count(b))
    ans = _ if _<ans else ans
    a+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

i = 1
temp = 1
while temp ** 2 <= N:
    if N % temp == 0:
        i = N // temp
        temp += 1
    else:
        temp += 1

print(max(len(str(i)), len(str(N // i))))

Submission status: Accepted

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

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

Submission status: Accepted

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

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
l = make_divisors(n)
# print(l)
# print(len(l))
print(len(str(l[len(l)//2])))

Submission status: Accepted

Solution code:
def get_keta(N):
    ans = 1
    while True:
        if N // 10 != 0:
            ans += 1
            N //= 10
        if N // 10 == 0:
            break
    return ans

N = int(input())
ans = get_keta(N)

for a in range(1, int(N ** 0.5) + 1):
    if N % a != 0:
        continue
    b= N // a
    tmp = max(get_keta(a), get_keta(b))

    if ans > tmp:
        ans = tmp
print(ans)

Submission status: Accepted

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


def main():
    n = int(input())
    i = int(n**(1/2))
    while n % i != 0:
        i -= 1
    print(len(str(n//i)))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
n = int(input())
if n == 1:
  print(1)
  sys.exit()
min_max = 1000
for div in range(1, int(n**(0.5) + 1)):
  if n % div == 0:
    a = div
    b = n // div
    fx = max(len(str(a)), len(str(b)))
    min_max = min(min_max, fx)
print(min_max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
ans = float("Inf")
for i in range(1,int(n**0.5)+2):
    count = 0
    if n % i == 0:
        a = max(n//i,i)
        while a:
            a = a // 10
            count += 1
        ans = min(ans,count)
print(ans)

Submission status: Accepted

Solution code:
# C - Digits in Multiplication
N = int(input())

A = int(N**0.5)
# print(A)
ans = 1
for i in range(A,0,-1):
    if N % i == 0:
        tmp = N / i
        ans = len(str(int(tmp)))
        break
    else:
        pass

print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
def isPrime(n):
  if n < 2:
    return False
  i = 2
  while i*i <= n:
    if n%i == 0:
      return False
    i += 1
  return True
if isPrime(N):
  print(len(str(N)))
else:
  ans = float("inf")
  i = 1
  while i <= math.sqrt(N):
    if N % i == 0:
      if i >= N // i:
        ans = min(ans,len(str(i)))
      else:
        ans = min(ans,len(str(N // i)))
    i += 1
  print(ans)

Submission status: Accepted

Solution code:
N=int(input())

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

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

Submission status: Accepted

Solution code:

import sys

stdin = sys.stdin

ns = lambda : stdin.readline().rstrip()
na = lambda : map(int, stdin.readline().split())
ni = lambda : int(ns())
def main():
  n = ni()
  if n == 1:
    print(1)
    return
  nagasa = lambda x: len(str(x))
  def f(a, b):
    x = nagasa(a)
    y = nagasa(b)
    return x if x > y else y

  def divi(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
  x = divi(n)
  ans = 1e9
  for a in x:
    b = n // a
    ans = min(ans, f(a, b))
  print(ans)

main()

Submission status: Accepted

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

from math import sqrt, floor


def f(x):
    for i in range(floor(sqrt(x)), 0, -1):
        if x % i == 0:
            return len(str(x // i))

    raise Exception


n = int(input())

ans = f(n)
print(ans)

Submission status: Accepted

Solution code:
from math import sqrt, ceil

N = int(input())

def main():
    n = N
    curr = ceil(sqrt(n))
    while 0 < curr:
        d, q = divmod(n, curr)
        if q == 0:
            ans = len(str(max(curr, d)))
            break
        curr -= 1
    print(ans)
    
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)
  A=sorted(divisors)
  p=len(A)//2
  return len(str(A[p]))
print(make_divisors(N))

Submission status: Accepted

Solution code:
n = int(input())
i = int(n**0.5)
while i:
    if n%i==0:print(max(len(str(i)), len(str(n//i))));break
    i-=1

Submission status: Accepted

Solution code:
n = int(input())

ansarr = []
a = 1

while a*a <= n:
    if n % a == 0:
        b = n // a
        ansarr.append(max(len(str(a)), len(str(b))))
    a += 1
print(min(ansarr))

Submission status: Accepted

Solution code:
import math as m
N = int(input())
F_ab = 0
for i in range(1, int(m.sqrt(N))+1):
    if N%i != 0:
        continue
    if i == 1:
        F_ab = len(str(N//i))
    else:
        F_ab = min(F_ab, max(len(str(i)), len(str(N//i))))

print(F_ab)

Submission status: Accepted

Solution code:
from sys import stdin
N = int(stdin.readline().rstrip())

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

    # divisors.sort()
    return divisors

fact = make_divisors(N)

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

Submission status: Accepted

Solution code:
n = int(input())
res = len(str(n))
for i in range(1, n // 2):
    if i**2 > n:
        break
    if n % i == 0:
        res = min([res, max(len(str(i)), len(str(n // i)))])
print(res)

Submission status: Accepted

Solution code:
n=int(input())
ans=len(str(n))

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

Submission status: Accepted

Solution code:
def main():

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

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 = inp()
d = make_divisors(n)
ans = mod
for i in d:
    tmp = n//i
    ans = min(max(len(str(tmp)), len(str(i))), ans)
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a,b,c = 0,0,float("Inf")
for i in range(1,int(n**0.5)+1):
    if n % i == 0:
        a = max(i,n//i)
        b = 0
        while not a == 0:
            a //= 10
            b += 1
        c = min(c,b)
print(c)

Submission status: Accepted

Solution code:

import sys
input = sys.stdin.readline
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
# A = [ int(input()) for _ in range(N) ]
##############################

N = int(input())

a = 1
ans = len(str(N))

while a*a <= N:
    if N%a == 0:
        b = N//a
        tmp = len(str(b))
        ans = min(ans, tmp)
    a += 1

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda :sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    ans=INF
    for i in range(1,int(n**.5)+1):
        if n%i: continue
        ans=min(ans,max(len(str(i)),len(str(n//i))))
    print(ans)
resolve()

Submission status: Accepted

Solution code:
def resolve():
    n = int(input())
    ans = 10 ** 9
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            f = max(len(str(i)), len(str(n // i)))
            if f < ans:
                ans = f
    print(ans)


if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

import time
s = time.time()
#prime = p_prime(10**5)
p = [i for i in range(1,10**5+1)]
g = time.time()
#print(g-s)

N = int(input())
ans = float("inf")
for i in p:
    if N%i == 0:
        #print(i)
        ans = min(ans, max(tenlog(i), tenlog(N//i)))
print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


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

    # divisors.sort()
    return divisors


n = I()
ret = INF
for a, b in make_divisors(n):
    ret = min(ret, max(len(str(a)), len(str(b))))


print(ret)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

n = int(input())

def keta(x):
    ans = 0
    while x != 0:
        x //= 10
        ans += 1
    return ans


ans = float("inf")
for i in range(1, int(n**0.5)+2):
    if n % i == 0:
        j = n // i
        ans = min(ans, max(keta(i), keta(j)))
print(ans)

Submission status: Accepted

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


N = int(input())
ans = 11
for div in divisor(N):
    ans = min(ans, max(len(str(div)), len(str(N // div))))

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
m = int(math.sqrt(n))
for i in range(m):
    k = m-i
    if n % k == 0:
        print(max(len(str(k)), len(str(n // k))))
        break

Submission status: Accepted

Solution code:
import math

n = int(input())
m = int(math.sqrt(n))
for i in range(m):
    if n % (m - i) == 0:
        print(max(len(str(m - i)), len(str(int(n / (m - i))))))
        break

Submission status: Accepted

Solution code:
N = int(input())

import math

lenN = len(str(N))

n = int(math.sqrt(N))
for i in range(1, n+1):
    if N % i == 0:
        x = len(str(i))
        y = len(str(N//i))
        
print(min(lenN, max(x, y)))

Submission status: Accepted

Solution code:
import math
n = int(input())
ans = int(math.sqrt(n))
while True:
  if n % ans == 0:
    ans = n // ans
    break
  else:
    ans -= 1
print(len(str(ans)))

Submission status: Accepted

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

Submission status: Accepted

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

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

    a = []
    b = []
    for i in range(1, int(pow(N, 0.5))+1):
        if N%i == 0:
            a.append(i)
            b.append(N//i)
    ans = int(1e10)
    for i in range(len(a)):
        ans = min(ans, max(len(str(a[i])), len(str(b[i]))))
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import math 

N = int(input())

ans = 1e+99
for a in range(1,math.floor(np.sqrt(N))+1):
  if N % a == 0:
    b = N // a
  else:
    continue
  d_a = 1 + int(np.log10(a))
  d_b = 1 + int(np.log10(b))
  F = max(d_a, d_b)
  if F < ans:
    ans = F
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import*;from itertools import*;from bisect import*
N=int(input());p=2;d={};q=[]
while p**2<=N:
 while N%p<1:N//=p;d[p]=d.get(p,0)+1
 p+=1
if N>1:d[N]=d.get(N,0)+1
for l in product(*[[k**i for i in range(v+1)]for k,v in d.items()]):
 a=1
 for n in l:a*=n
 insort(q,a)
print(floor(log10(q[len(q)//2]))+1)

Submission status: Accepted

Solution code:
import math
N = int(input())
num = int(N**0.5)
flg = True
while flg:
    if N % num == 0:
        ans = int(math.log10(N//num)) + 1
        flg = False
    else:
        num -= 1
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = len(str(N))

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = len(str(n))
for i in range(1, int(n**(1/2))+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())

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

Submission status: Accepted

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

dN = math.floor(N**(1/2))


tmp = 0
for i in range(1,dN+1):
	if N % i == 0:
		tmp = max(tmp, i)

tmp_co = N // tmp

print(max(len(str(tmp)), len(str(tmp_co))))

Submission status: Accepted

Solution code:
N = int(input())
a = len(str(N))

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

print(a)

Submission status: Accepted

Solution code:
def keta(n):
    cnt=1
    while(n//10!=0):
        n=n//10
        cnt+=1
    return cnt

def main():
    n=int(input())
    ans=n
    r=n**0.5
    r=int(r)
    r+=1
    for i in range(r):
        i+=1
        if(n%i==0):
            ans=min(max(keta(i),keta(n//i)),ans)
    print(ans)
    
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


div = make_divisors(N)
ans = 10**10+3
for d in div:
    d2 = N//d
    tmp = max(len(str(d)),len(str(d2)))
    ans = min(ans,tmp)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

import math

ans = len(str(N))

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

if __name__ == '__main__':
    N = int(input())
    root_N_int = math.floor(math.sqrt(N))
    for A in range(root_N_int, 0, -1):
        if N % A == 0:
            B = int(N / A)
            break
    digit = len(str(B))
    print(digit)

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

ans=float('inf')
for i in range(len(li)):
    for j in range(i,len(li)):
        if li[i]*li[j]==n:
            ans=min(ans,max(len(str(li[i])),len(str(li[j]))))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt, log10

N = int(input())

ans = [max(int(log10(i)), int(log10(N // i))) for i in range(1, int(sqrt(N)) + 1) if not N % i]

print(min(ans) + 1)

Submission status: Accepted

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

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

yakusu = make_divisors(n)
yakusu.sort()

ans = 10

for i in range(len(yakusu)):
    ans = min(ans,max(len(str(yakusu[i])), len(str(n//yakusu[i]))) )
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import copy
import string
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: 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

n = ni()
li = make_divisors(n)
ans = 10000000000000000
for i in range(len(li) // 2):
    if li[i] * li[-(i+1)] == n:
        f = max(len(str(li[i])), len(str(li[-(i+1)])))
        ans = min(f, ans)
if len(li) % 2 != 0:
    if len(li) == 1:
        ans = 1
    else:
        print()
        ans = min(len(str(li[len(li)//2])), ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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


n = int(input())

ret = float('inf')
a = 0
while a * a <= n:
    a += 1
    if n % a != 0:
        continue
    b = n // a
    ret = min(ret, f(a, b))
print(ret)

Submission status: Accepted

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

root = int(math.sqrt(n))
for i in range(root, 0, -1):
    if n%i == 0:
        a = i
        b = n // i
        break

cnt = 1
while b // 10 >= 1:
    cnt += 1
    b = b // 10
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())
ret = len(str(N))
t = 2
while t * t <= N:
  if N % t == 0:
    ret = min(ret, max(len(str(N//t)), len(str(t))))
  t += 1
print(ret)

Submission status: Accepted

Solution code:
import math
import fractions
N=int(input())
A=math.sqrt(N)
A=math.ceil(A)
mini=100000000000
for i in range(1,A+1):
    if N%i==0:
        x=len(str(i))
        y=len(str(N//i))
        if mini>max(x,y):
            mini=max(x,y)
print(mini)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
x = int(N**0.5)

for i in range(x, 0, -1):
    if N%i == 0:
        ans = len(str(N//i))
        break

print(ans)

Submission status: Accepted

Solution code:
#057
n=int(input())
i=0
l=[]
while i**2<n:
    i+=1
    if n%i==0:
        l.append(max(len(str(i)),len(str(int(n/i)))))
print(min(l))

Submission status: Accepted

Solution code:
n = int(input())

ab = []
ans = []
for i in range(1, int(n**(0.5))+1):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			
if len(ans) == 0:
	ans.append(1)

print(min(ans))

Submission status: Accepted

Solution code:
n = int(input())
fmin = 100
for i in range(1,int(n**0.5)+1):
  a = i
  b = n // i
  if b != n/i :
    continue
  
  alen = len(str(a))
  blen = len(str(b))
  f = max(alen, blen)
  fmin = min(fmin,f)
print(fmin)