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
import queue
from collections import defaultdict
 
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def printQueue(q):
	r=qb
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
def dq():
	return queue.deque()
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1

n = readInt()

def f(a,b):
	return math.floor(math.log10(max(a,b))+1)

ans = f(0,n)
for i in range(1,math.floor(pow(n,0.5)+1)):
	if n%i==0:
		ans = min(ans,f(i,n//i))

print(ans)

Submission status: Accepted

Solution code:
"""
master of 整数
素因数分解
https://qiita.com/drken/items/a14e9af0ca2d857dad23
"""

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

print(ans)

Submission status: Accepted

Solution code:
import math
n=int(input())
ans=11
for i in range(int(n**0.5)+3,0,-1):
    if n%i==0:
        ans=min(ans,int(math.log(n/i,10))+1)
print(ans)

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)
        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:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


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


n = int(read())
print(make_divisors(n))

Submission status: Accepted

Solution code:
N = int(input())


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


ans = 10**30
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:
n = int(input())


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

ans = len(str(n))
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:
N = int(input().strip())

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

f = N
for i in range(1, N):
    if i * i > N:
        break
    if N % i == 0:
        _f = F(i, N // i)
        f = min(f, _f)

print(f)

Submission status: Accepted

Solution code:
N=int(input())

divisor_set=set()
for i in range(1,int(N**0.5)+1):
  if N%i==0:
    divisor_set.add(i)
    divisor_set.add(N//i)
#print(divisor_set)

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

min_answer=float("inf")
for d in divisor_set:
  d1=d
  d2=N//d
  min_answer=min(min_answer,f(d1,d2))
  
print(min_answer)

Submission status: Accepted

Solution code:
n = int(input())
a = int(n**0.5)
while n % a != 0:
  a -= 1
b = n//a
print(len(str(max(a,b))))

Submission status: Accepted

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

print(len(str(B)))

Submission status: Accepted

Solution code:
N = int(input())
N2 = int(N ** (1/2))
ans1 = N
ans2 = 1
for i in range(1, N2 + 1):
    if N % i == 0:
        ans2 = str(i)
        ans1 = str(N // i)

print(max(len(ans1), len(ans2)))

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())

for i in range(int(N**0.5)+1, 0, -1):
    div, mod = divmod(N, i)
    if not mod:
        print(len(str(max(div, N//div))))
        exit()

Submission status: Accepted

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

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

ans = 0
nn = int(math.sqrt(n))
for i in range(nn+1,0,-1):
  if(n%i == 0):
    x = f(i,int(n/i))
    ans = x
    break
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

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

Submission status: Accepted

Solution code:
N = int(input())
d = int(N ** .5)
ans = 10**10
for i in range(1,d+1):
	div, mod = divmod(N, i)
	if mod:
		continue
	tmp = max(len(str(i)), len(str(div)))
	ans = min(ans, tmp)


print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

Submission status: Accepted

Solution code:
def number_of_digits(a,b):
    num_of_digits_a=1
    num_of_digits_b=1
    while a//10 !=0:
        a=a//10
        num_of_digits_a +=1
    while b//10 !=0:
        b=b//10
        num_of_digits_b +=1
    if num_of_digits_a >= num_of_digits_b:
        return(num_of_digits_a)
    else:
        return(num_of_digits_b)

N=int(input())
ans=0
for i in range(1,10**5+1):
    if N%i ==0:
        tmp = number_of_digits(i,N//i)
        if i==1:
            ans=tmp
        else:
            if ans>tmp:
                ans=tmp
print(ans)

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)
  return divisors
 
def digit(n):
  for i in range(11):
    if n>=10**i and n<10**(i+1):
      return i+1
      break
 
list = make_divisors(n)
 
ans = 12
 
for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))
 
print(ans)

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

def digit(n):
  for i in range(15):
    if n>=10**i and n<10**(i+1):
      return i+1
      break

list = make_divisors(n)

ans = 2345

for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))

print(ans)

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()

for i in range(int(N**0.5)+1, 0, -1):
	if N%i == 0:
		a = i
		b = N//i
		break

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

Submission status: Accepted

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

N = INT()
ans = 12

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

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

N = int(input())

div = make_divisors(N)
ans = len(str(N))
ans = min(ans,len(str(div[-1])))
print(ans)

Submission status: Accepted

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
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 = int(input())
a = make_divisors(n)
ans = len(str(a[len(a)//2]))
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:
a=int(input())
ans=a
for i in range(1,int(a**(1/2))+2):
    if a%i==0:
        if ans>len(str(a//i)):
            ans=len(str(a//i))
print(ans)

Submission status: Accepted

Solution code:
import math

def order(A, B):
    ord_A = int(math.log10(A) + 1)
    ord_B = int(math.log10(B) + 1)
    return max(ord_A, ord_B)

def solve():
    N = int(input())
    d = 10**12
    i = 1
    while i**2 <= N:
        if N % i == 0:
            d = min(d, order(i, N//i))
        i += 1
        
    print(d)
    
if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
from sys import stdin
import math


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N = int(_in[0])  # type:int
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    cnt = float('inf')
    for A in range(1,int(math.sqrt(N))+1):
        if N%A==0:
            B = N//A
            cnt = min(cnt,max(len(str(A)),len(str(B))))
    # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)

Submission status: Accepted

Solution code:
import sys
import math

N = int(sys.stdin.readline().rstrip())

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

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

    return ans

if __name__ == "__main__":
    n = int(input())
    print(solve(n))

Submission status: Accepted

Solution code:
import math
n=int(input())
f=[]
for a in range(1,math.floor(n**(1/2))+1):
    if n%a==0:
        f.append(len(str(n//a)))
print(min(f))

Submission status: Accepted

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

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**(1/2))+1):
    j = n / i
    if (n/i)%1 == 0:
        j = n // i
        if ans > F(i, j):
            ans = F(i, j)
        
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = 1000000
for i in range(1,math.ceil(math.sqrt(N))+1):
    if N%i == 0:
        a = i
        b = N//i
        f = max(len(str(a)),len(str(b)))
        if f < ans:
            ans = f
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
a = round(n**0.5)
while n % a != 0:
  a -= 1
b = n//a
print(len(str(max(a,b))))

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())
ans = 20

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

print(ans)

Submission status: Accepted

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

N = int(input())

n = int(N**(1/2))

min = 10
for i in range(1, n+1):
    if N % i == 0:
        A = i
        B = int(N / i)
        
        max = F(A, B)
        
        if max < min:
            min = max
else:
    print(min)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
sqrtn = math.sqrt(n)
f = 0
ans = 10**10
for i in range(1, int(sqrtn)+1):
    div, mod = divmod(n, i)
    if mod == 0:
        f = max(len(str(div)), len(str(i)))
        if ans > f:
            ans = f
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

def digits_in_multiplication(N):
    if N == 1:
        return tmp

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

    return ans

print(digits_in_multiplication(N))

Submission status: Accepted

Solution code:
import math
N = int(input())
res = []
num = []
for i in range(1, int(math.sqrt(N+1))+1):
  if N % i == 0:
    div = N // i
    if div >= i:
      str_num = str(div)
      res.append(len(list(str_num)))
print(min(res))

Submission status: Accepted

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

def F(A, B):
  return max(count_digit(A), count_digit(B))

N = int(input())
mn = 10
for i in range(1, int(N**(1/2)) + 1):
  if N % i == 0:
    if mn > F(i, N//i):
       mn = F(i, N//i)
print(mn)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

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

def main():
  N = int(input())
  ans = len(str(N))
  n_sq = math.floor(math.sqrt(N))

  for i in range(n_sq, 0, -1):
    if(N % i == 0):
      j = N // i
      ans = F(i, j)
      break

  print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import numpy as np

from sys import stdin


def main():
    n = int(stdin.readline())
    d = set()
    ans = len(str(n))
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            d.add(i)
    for a in d:
        tmp = np.max([len(str(a)), len(str(int(n / a)))])
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
import math
r = math.sqrt(n)
l1 = []
l2 = []
for i in range(1, int(r+1)):
    if n % i == 0:
        a = i
        b = n / i
        if a <= b:
            l1.append([str(a), str(int(b))])

for j in l1:
    u = j[0]
    v = j[1]
    if len(u) >= len(v):
        f = len(u)
    else:
        f = len(v)
    l2.append(f)

print(min(l2))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def nyu():
    N = int(input())
    return N

def kansu(N):
    min = 9999999999

    tmp_n = int(math.sqrt(N))

    for n in range(1,tmp_n+1):
        if N % n == 0:
            n2  = str(int(N/n))
            n1 = str(n)
            

            if len(n2) > len(n1):
                tmp = int(len(n2))
            else:
                tmp = int(len(n1))
        
        if min>tmp:
            min  = tmp
    print(min)






N = nyu()
kansu(N)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
import numpy as np
t=0
i=int(np.sqrt(N))
while True:
    if N%i==0:
        t=max(len(str(int(N/i))), len(str(int(i))))
        break
    i-=1
print(t)

Submission status: Accepted

Solution code:
import math
N = int(input())
ans = float("inf")
for i in range(1, math.ceil(math.sqrt(N)+1)):
  if N % i == 0 and ans > len(str(N // i)):
    ans = len(str(N // i))
print(ans)

Submission status: Accepted

Solution code:
import math

N = int(input())

def cnt_digits(N):
    ctr = 0
    while N>0:
        N = int(N/10)
        ctr += 1

    return ctr

ans = cnt_digits(N)

for i in range(1, int(math.sqrt(N)+1)):
    if N%i != 0: continue
    B = int(N/i)
    cur = max(cnt_digits(i),cnt_digits(B))

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

Submission status: Accepted

Solution code:
import math
n = int(input())
mi =11
def f(a,b):
    return max(int(math.log10(a))+1,int(math.log10(b))+1)

for i in range(1,int(math.sqrt(n))+1):
    if n%i==0:
        t=f(i,n//i)
        if t<mi:
            mi=t
print(mi)

Submission status: Accepted

Solution code:
import math
N = int(input())
m = int(math.sqrt(N)+1)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

divisor_list = make_divisors(n)

for num in divisor_list:
    if num >= n**0.5:
        print(len(str(num)))
        sys.exit()

Submission status: Accepted

Solution code:
def main():
    # 入力
    s = input()

    x = len(s)
    limit = int(x/2)+1 if x % 2 == 0 else int(x/2)+2
    limit2 = int(x/2) if x % 2 == 0 else int(x/2)+1

    n = int(s)

    min_l = 11

    # ccc = 0
    for i in range(1, n+1):
        # ccc += 1
        il = len(str(i))
        if il == limit:
            break
        if n % i != 0:
            continue
        if il == min_l:
            break
        j = int(n / i)

        jl = len(str(j))
        f = max(il, jl)
        if f < min_l:
            min_l = f
        if jl == limit2 or il == jl or il > jl:
            break


    # print(ccc)
    print(min_l)


main()

Submission status: Accepted

Solution code:
import math
n = int(input())
divset = []


m = math.ceil(math.sqrt(n))
for i in range(m, 0, -1):
    if n % i == 0:
        j = n / i
        print(max(math.floor(math.log10(i)), math.floor(math.log10(j)))+1)
        exit()

Submission status: Accepted

Solution code:
import math

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

ans=[]

for i in range(1,n_sqrt+1):
  if n%i==0:
    x=int(max(math.log10(i)+1,math.log10(n//i)+1))
    ans.append(x)

print(min(ans))

Submission status: Accepted

Solution code:
import math


def keta(num):
    count = 1
    while num >= 10:
        num = num / 10
        count += 1

    return count


N = int(input())

sqrt_N = int(math.sqrt(N))

A = 1
for i in range(1, sqrt_N+1):
    if N % i == 0:
        A = i

B = N // A

print(max(keta(A), keta(B)))

Submission status: Accepted

Solution code:
import math
mx = float("inf")
n = int(input())
for i in range(1,round(math.sqrt(n))+1):
  if n % i == 0:
    if max(len(str(i)),len(str(n//i))) < mx:
           mx = max(len(str(i)),len(str(n//i)))
print(mx)

Submission status: Accepted

Solution code:
import math

n = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
B = int(math.sqrt(N))
while B > 0:
    if N % B == 0:
        break
    B -= 1
print(len(str(int(N / B))))

Submission status: Accepted

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

    divisors.sort(reverse = True)
    return divisors
#print(make_divisors(n))
if n != 1:
    ans = float('inf')
    p = 1 if len(make_divisors(n))%2 == 1 else 0
    for i in range(len(make_divisors(n))//2+p):
        ans = min(ans, make_divisors(n)[i])
    print(len(str(ans)))
else:
    print(1)

Submission status: Accepted

Solution code:
def div(n):
	a = []
	for i in range(1, int(n**0.5+1)):
		if n % i == 0:
			a.append(i)
			a.append(n//i)
	return sorted(a)
def resolve():
	n = int(input())
	d = div(n)
	v = len(str(max(d[len(d)//2], d[len(d)//2-1])))
	print(v)
resolve()

Submission status: Accepted

Solution code:
import math

N = int(input())
ret = len(str(N))
for x in reversed(range(int(math.sqrt(N)) + 2)):
    if N % x == 0:
        ret = max(len(str(x)), len(str(N // x)))
        break

print(ret)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

min_length = -1
for A in range(1, int(math.sqrt(N)) + 1, 1):
    if N % A == 0:
        B = int(N / A)
        len_a = len(str(A))
        len_b = len(str(B))
        length = len_a if len_a >= len_b else len_b
        if min_length == -1 or length < min_length:
            # print("len:{}, A:{}, B:{}".format(length, A, B))
            min_length = length
print(min_length)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0:
        shou = n // i
        f = max(len(str(shou)), len(str(i)))
        lis.append(f)
print(min(lis))

Submission status: Accepted

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

Submission status: Accepted

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

n = int(input())
counter = 0

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

Submission status: Accepted

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

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

def main():
    N = int(readline())
    divisors = make_divisors(N)
    le = len(divisors)
    if le % 2 == 1:
        print(len(str(divisors[le//2])))
    else:
        print(len(str(divisors[le//2])))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

root_n = n**0.5
if (root_n != int(root_n)):
    root_n = int(root_n)+1
else:
    root_n = int(root_n)    

for i in range(root_n, 0, -1):
    if(n%i == 0):
        ans = int(n/i)
        print(max([len(str(i)), len(str(ans))]))
        break

Submission status: Accepted

Solution code:
import sys,math
n = int(input())
ans = sys.maxsize
for i in reversed(range(1, math.sqrt(n).__int__() + 1)):
    if n % i == 0:
        cur = max(len(str(i)), len((str(n // i))))
        if ans > cur:
            ans = cur

if n == 1:
    print(1)
else:
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

N = int(input())
ans = 10**11
for d in make_divisors(N):
    keta = max(len(str(d)), len(str(N//d)))
    ans = min(keta, ans)

print(ans)

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    factors = prime_factors(N)
    minf = float("inf")
    
    for bits in range(1<<len(factors)):
        fac_a = 1
        for odr in range(len(factors)):
            if bits & (1<<odr):
                fac_a *= factors[odr]

        fac_b = N // fac_a
        l = max(len(str(fac_a)), len(str(fac_b)))
        minf = min(minf, l)
    print(minf)

def prime_factors(n):
    i = 2
    factors = []
    while i**2 <= n:
        if n % i != 0:
            i += 1
        else:
            factors.append(i)
            n = n // i
    if n > 1:
        factors.append(n)
    return factors
    



if '__main__' == __name__:
    resolve()

Submission status: Accepted

Solution code:
n = int(input())
ans = float('inf')
for factor in range(1,int(n**0.5)+2):
    if n % factor == 0:
        factor1 = factor
        factor2 = n // factor1
        bigger = max(factor1, factor2)
        num_d = len(str(bigger))
        ans = min(ans, num_d)
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    sq = int(pow(n,0.5))

    while True:
        if n % sq == 0:
            break
        sq-=1

    a = n//sq
    k = 0
    while a:
        a = a//10
        k+=1 

    print(k)
main()

Submission status: Accepted

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