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: Time Limit Exceeded

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

    mi = sys.maxsize
    for x in range(1, n + 1):
        if n % x == 0:
            mi = min(mi, max(len(str(x)), len(str(int(n / x)))))
    print(mi)


if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

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

elements = []

for i in range(1, N+1):
    if N % i == 0: elements.append(i)

a = elements[len(elements)//2]
b = N // a
print(F(a,b))

Submission status: Time Limit Exceeded

Solution code:
from math import ceil, sqrt, floor, log10

N = int(input())

for i in range(ceil(sqrt(N)), N + 1):
    if N % i == 0:
        print(floor(log10(i)) + 1)
        break

Submission status: Time Limit Exceeded

Solution code:
import math
N = int(input())
n = int(math.sqrt(N))
if N/n == n:
    print(int(math.log10(n)+1))
else:
    while N%n != 0:
        n+=1
    print(int(math.log10(n) + 1))

Submission status: Time Limit Exceeded

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

if N < 1:
    l = []
elif N == 1:
    l = [1]
else:
    l = []
    l.append(1)
    [l.append(i) for i in range(2, N//2 + 1) if N % i == 0]
    l.append(N)
l = list(map(str,l))
L = len(l)
r = [max(len(l[i]), len(l[L-i-1])) for i in range(int((L+1)//2))]
print(min(r))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
import math
m = math.ceil(math.sqrt(N))
while N%m!=0:
    m += 1
print(int(math.log10(m))+1)

Submission status: Time Limit Exceeded

Solution code:
# coding: utf-8
# Here your code !
import numpy as np
import math as mt
n = int(input())
half = mt.floor(mt.sqrt(n))

while n % half !=0:
    half += 1
    

print(max(mt.floor(mt.log(half,10)),mt.floor(mt.log(n/half,10)))+1)

Submission status: Time Limit Exceeded

Solution code:
import math
N=int( input())
for r in range (int(math.sqrt(N)),N+1):
  if N%r==0:
    count=1
    for i in range (0,9):
      r=r/10
      if r<1:
        print(count)
        break
      count+=1
    break

Submission status: Time Limit Exceeded

Solution code:
import sys
import math

n = int(sys.stdin.readline().strip())

a = math.ceil(math.sqrt(n))
for i in range(a, n+1):
    if n % i == 0:
        m1 = i
        m2 = int(n/i)
        break
    else:
        continue

ord1 = int(math.log10(m1) + 1)
ord2 = int(math.log10(m1) + 1)
ans = max(ord1, ord2)
print(ans)

Submission status: Time Limit Exceeded

Solution code:
#! coding: UTF-8
num = int(input())
#桁数
def digit(x):
    point = 0
    while int(x) > 0:
        x /= 10
        point += 1
    return point
#num=A*Bの時の最小桁数
def Multi(num):
    y = digit(num)
    for A in range(1,num):
        if A*A <= num:
            if num%A == 0:
                B = num/A
                C = max(digit(A),digit(B))
                if y > C:
                    y = C
    print(y)
Multi(num)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn+=1
ans = len(str(nn))
print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
import itertools
def f(a, b):
    return max(len(str(a)), len(str(b)))
def p(n):
    l = []
    a, b = 0, 2
    while b * b <= n:
        if n % b == 0:
            n //= b
            l += [b]
        else:
            b += 1 + a
            a = 1
    if n > 1 : l += [n]
    return l

def main():
    N = int(input())
    l = p(N)
    if len(l) < 2:
        print(f(N, 1))
    else:
        w = len(l)
        ans = len(str(N))
        for i in itertools.product([0, 1], repeat=w):
            a = b = 1
            for j in range(w):
                if i[j] == 0:
                    a *= l[j]
                else:
                    b *= l[j]
            ans = min(ans, f(a, b))
        print(ans)
if __name__ == '__main__':
    main()

Submission status: Time Limit Exceeded

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

n = int(input())

i = 1
digit = float('inf')
sq = math.sqrt(n)
while i<=n:
    if not n%i == 0:
        pass
    elif sq < i:
        break
    else:
        tmp = max(len(str(i)),len(str(int(n/i))))
        digit = min(tmp,digit)
    i += 1
print(int(digit))

Submission status: Time Limit Exceeded

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

n = int(input())

i = 1
digit = float('inf')
sq = math.sqrt(n)
while i<=n:
    if not n%i == 0:
        pass
    elif sq < i:
        break
    else:
        digit = min(max(len(str(i)),len(str(int(n/i)))),digit)
    i += 1
print(int(digit))

Submission status: Time Limit Exceeded

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

n = int(input())

i = 1
digit = float('inf')
sq = math.sqrt(n)
while True:
    if not n%i == 0:
        pass
    elif sq < i:
        break
    else:
        digit = min(max(len(str(i)),len(str(int(n/i)))),digit)
    i += 1
print(int(digit))

Submission status: Time Limit Exceeded

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

a=int(math.sqrt(n))

if n%2 != a%2: a+=1
while n%a != 0:a+=2

b=int(n/a)

a_dig = len(str(a))
b_dig = len(str(b))

ans=max(a_dig,b_dig)

print(ans)

Submission status: Time Limit Exceeded

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

a=int(math.sqrt(n))

if n%2 != 0:
    if a%2==0: a+=1
    while n%a != 0:a+=2
else:
    while n%a != 0:a+=1

b=int(n/a)

a_dig = len(str(a))
b_dig = len(str(b))

ans=max(a_dig,b_dig)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())

def prime_decomposition(n):
    # 素因数分解
    if n < 2:
        return []
    prime_factors = []
    while n % 2 == 0:
        prime_factors.append(2)
        n >>= 1

    while n % 3 == 0:
        prime_factors.append(3)
        n //= 3

    a = 5
    b = 7
    while a ** 2 <= n:
        if n % a == 0:
            prime_factors.append(a)
            n //= a
        elif n % b == 0:
            prime_factors.append(b)
            n //= b
        else:
            a += 6
            b += 6
    if n > 1:
        prime_factors.append(n)
    return prime_factors

pfs = prime_decomposition(n)
pfs.reverse()

def ds(n):

    ret = 1
    while 10**ret <= n:
        ret += 1
    return ret

ln = len(pfs)
size = 2**ln

min_v = 100
for i in range(size):
    p = 1
    for j in range(ln):
        if 1<<j & i:
            p *= pfs[j]
    min_v = min(min_v, max(ds(p), ds(n//p)))
print(min_v)

Submission status: Time Limit Exceeded

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

def digs(n):
	for i in range(int((n + 0.1) ** 0.5), int(n // 2) + 1):
		if (n % i == 0):
			print(countDigs(i))
			return
	print(countDigs(n))

digs(int(input()))

Submission status: Time Limit Exceeded

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

a=int(math.sqrt(n))

while True:
    if n%a==0:break
    else: a+=1

b=int(n/a)

a_dig = len(str(a))
b_dig = len(str(b))

ans=max(a_dig,b_dig)

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import itertools
def f(a, b):
    return max(len(str(a)), len(str(b)))
def p(n):
    l = []
    a, b = 0, 2
    while b * b <= n:
        if n % b == 0:
            n //= b
            l += [b]
        else:
            b += 1 + a
            a = 1
    if n > 1 : l += [n]
    return l

N = int(input())
l = p(N)
if len(l) < 2:
    print(f(N, 1))
else:
    w = len(l)
    ans = len(str(N))
    for i in itertools.product([0, 1], repeat=w):
        a = b = 1
        for j in range(w):
            if i[j] == 0:
                a *= l[j]
            else:
                b *= l[j]
        ans = min(ans, f(a, b))
    print(ans)

Submission status: Time Limit Exceeded

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

n = int(input())

i = 1
digit = float('inf')
while True:
    if not n%i == 0:
        pass
    elif math.sqrt(n) < i:
        break
    else:
        digit = min(max(len(str(i)),len(str(int(n/i)))),digit)
    i += 1
print(int(digit))

Submission status: Time Limit Exceeded

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

a=int(math.sqrt(n))

while True:
    if n%a==0:break
    else: a+=1

b=(n/a)

a_dig = int(math.log10(a))+1
b_dig = int(math.log10(b))+1

ans=max(a_dig,b_dig)

print(ans)

Submission status: Time Limit Exceeded

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

n = int(input())

def maxdigit(a,b):
    loga10 = math.log10(a) + 1
    logb10 = math.log10(b) + 1
    return max(loga10,logb10)

i = 1
digit = float('inf')
while True:
    if not n%i == 0:
        pass
    elif math.sqrt(n) < i:
        break
    else:
        digit = min(maxdigit(i,n/i),digit)
    i += 1
print(int(digit))

Submission status: Time Limit Exceeded

Solution code:
import math

n=int(input())

def keta(n):
    return int(math.log10(n)+1)
def max(a,b):
    if a>b :return a
    else: return b

result=100
for i in range(1,n//2+10):
    if n%i==0 and result>max(keta(i),keta(n//i)):
        result=max(keta(i),keta(n//i))
print(result)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#n, *d = map(int, open(0).read().split())
# dream dreamer erase eraser 
n=int(input())

def f(a,b):
    return max(len(str(a)),len(str(b)))
m=10000
for a in range(1,10**10):
    if n%a==0:
        m=min(f(a,n//a),m)
    if n<a or n//a<a:
        break
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    N = i_input()
    ans = INF

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

        b = N // i
        ans = min(ans, len(str(b)))
    print(ans)

  
 
  
if __name__=="__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())

def divs(n:int) -> list:
    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)
    divs.sort()
    return divs

div_l = divs(n)
print (max(len(str(div_l[(len(div_l)//2)-1])), len(str(div_l[len(div_l)//2]))))

Submission status: Accepted

Solution code:
N=int(input())

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

i=1
ans=float("inf")
while i**2<=N:
  if N%i==0:
    temp=f(i, N//i)
    ans=min(ans, temp)
  i+=1
print(ans)

Submission status: Accepted

Solution code:
n = int(input())

x = int(n ** 0.5)

for i in range(x):
    if n % (x - i) == 0:
        print(len(str(n // (x - i))))
        break

Submission status: Accepted

Solution code:
n = int(input())
ans = []
    
for i in range(1,int(n**0.5) + 1):
  if (n/i).is_integer():
    a = len(str(i))
    b = len(str(int(n/i)))
    x = max(a,b)
    ans.append(x)
    

print(min(ans))

Submission status: Accepted

Solution code:
import math
n = int(input())
s = math.ceil(math.sqrt(n))
h = 10**5
for i in range(1,s+1):
  if n%i==0:
    if h > max(len(str(i)),len(str(int(n/i)))):
      h = max(len(str(i)),len(str(int(n/i))))
print(h)

Submission status: Accepted

Solution code:
N=int(input())

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

    B=N//A
    ans=min(ans,max(len(str(A)),len(str(B))))

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
ans = float("inf")

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

n = input()
answer =  len(n)
number = int(n)
for a in range(int(math.sqrt(int(n))),1,-1):
  if number%a != 0:
    continue
  b = number//a
  answer = min(answer, max(len(str(a)),len(str(b))))
  break
  
print(answer)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num = int(input())

digits = len(str(num))

ans = digits

for i in range(1,10 ** (digits // 2 + 1)):
    if num % i == 0:
        target = max(len(str(i)), len(str(num//i)))
        if ans >= target:
            ans = target
        else:
            print(ans)
            exit()
print(ans)

Submission status: Accepted

Solution code:
n=int(input())

for i in range(int(n**0.5),0,-1):
    if n%i==0:
        break

print(len(str(n//i)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Problem: https://atcoder.jp/contests/abc057/tasks/abc057_c
# Python 1st Try

import sys
# from collections import defaultdict
# import heapq,copy
import pprint as pp
# from collections import deque
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]


# Const
MAXSIZE = ( 1 << 31 ) -1
MINSIZE = -( 1 << 31) + 1


def solver(input_int):
    result = len(str(input_int))
    for j in range(1, int(input_int**0.5) +1 , +1):
        divide_check = (input_int % j) != 0
        if divide_check:
            continue
        divide_value = input_int // j
        long_check = len(str(divide_value)) <= result
        if long_check:
            result = len(str(divide_value))
    # algorithm
    return result


if __name__ == "__main__":
    N = II()
    print("{}".format(solver(N)))

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]

yakusu = make_divisors(n)
l_yakusu = len(yakusu)
idx = 0

mx = 10

for a in range(1,10**5+1):
    if a>n:
        break
    if idx<l_yakusu and a==yakusu[idx]:
        idx += 1
        keta_a = len(str(a))
        keta_b = len(str(n//a))
        f = max(keta_a, keta_b)
        mx = min(mx, f)

print(mx)

Submission status: Accepted

Solution code:
import math

N = int(input())
A = []
B = []
num_list = []

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


def solv(N):
    for i in range(1,root+1):
        if N%i == 0:
            A.append(i)
            B.append(N//i)
    for a,b in zip(A,B):
        a_str = str(a)
        b_str = str(b)
        a_num = len(a_str)
        b_num = len(b_str)
        if a_num > b_num:
            num_list.append(a_num)
        elif a_num < b_num:
            num_list.append(b_num)
        else:
            num_list.append(a_num)
    return print(min(num_list))

solv(N)

Submission status: Accepted

Solution code:
N = int(input())

M = 1

for i in range(1, int(N ** (1/2)) + 1):
   if N % i == 0:
      if M < i:
         M = i

M = N // M

ndm = len(list(str(M)))

print(ndm)

Submission status: Accepted

Solution code:
N=int(input())

def divisors(N):
    result = 1e12
    for i in range(2, N):
        if i**2>N:
            break
        if N%i==0:
            B=int(N/i)
            tmp = max(len(str(B)), len(str(i)))
            result = min(result, tmp)
    # 自身でしか割れない
    if result==1e12:
        result = len(str(N))
    return result

print(divisors(N))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

print(res)

Submission status: Accepted

Solution code:
N = int(input())

out=10**10
for A in range(1,int(N**(1/2))+2):
    if N%A == 0:
        B = N//A
        KA, KB = len(str(A)), len(str(B))
        dam = max(KA,KB)
        out=min(out,dam)

print(out)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def cal(N):
    num=(N**0.5)//1
    num=int(num)
    for i in range(num,0,-1):
       if N%i==0:
           k=int(N/i)
           x=len(str(k))
           break
    return x

print(cal(int(input())))

Submission status: Accepted

Solution code:
import sys

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]


input = sys.stdin.readline

n = int(input())

yaku_list = make_divisors(n)
length = len(yaku_list)
half_index = int(length/2)

a = 0
b = 0
if length % 2 == 0:
    a = yaku_list[half_index]
    b = yaku_list[half_index-1]
else:
    a = yaku_list[half_index]
    b = a

keta_a = len(str(a))
keta_b = len(str(b))

print(max(keta_a,keta_b))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())

def cal(a):
  return len(str(a))
m = 11
for j in range(1,10**5+1):
  if n%j==0:
    m = min(m,max(cal(j),cal(n//j)))
    # print(m)
print(m)

Submission status: Accepted

Solution code:
n = int(input())

def cal(a):
  return len(str(a))
m = 11
for j in range(1,10**6+1):
  if n%j==0:
    m = min(m,max(cal(j),cal(n//j)))
    # print(m)
print(m)

Submission status: Accepted

Solution code:
n = int(input())

def cal(a):
  return len(str(a))
m = 11
for i in range(1,6):
  for j in range(1,10**i+1):
    if n%j==0:
      m = min(m,max(cal(j),cal(n//j)))
      # print(m)
print(m)

Submission status: Accepted

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

Submission status: Accepted

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

ans = len(n)
N = int(n)

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


print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def ten(p):
    if p == 0:
        return 0
    else:
        return ten(p // 10) + 1
N = int(input())
x = int(math.sqrt(N))
while N % x != 0:
    x -= 1
y = int(N / x)

print(ten(y))

Submission status: Accepted

Solution code:
def get_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            upper_divisors.append(n//i)
        i += 1
    return [lower_divisors, upper_divisors]

n = int(input())

up = get_divisors(n)[0]
dn = get_divisors(n)[1]

ans = 11
for a, b in zip(up, dn):
    a = str(a)
    b = str(b)
    f = max(len(a), len(b))
    ans = min(ans, f)

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
high_divs = []
k = 1

while k*k <= N:
  if N%k == 0:
    high_divs.insert(0,N//k)
  k += 1

print(len(str(high_divs[0])))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
def solve(n):
    i = 1
    ans = 10000000
    while i*i <= n:
        if n % i == 0:
            lower = i
            if i != n // i:
                upper = n//i
            else:
                upper = i
            anstmp = max(len(str(lower)), len(str(upper)))
            if ans > anstmp:
                ans = anstmp
        i += 1
        
    return ans

print(solve(n))

Submission status: Accepted

Solution code:
n=int(input())

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

flist=[]
a=int(n**0.5)

for i in range(1,a+1):
    if n%i==0:
        j=int(n/i)
        tmp=f(i,j)
        flist.append(tmp)
print(min(flist))

Submission status: Accepted

Solution code:
from math import sqrt
def solve():
    N = int(input())
    ans = float('inf')
    for A in range(1,int(sqrt(N))+1):
        if N % A == 0:
            ans = min(ans, len(str(N//A)))
    
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
a = int(input())
mini = 10 ** 10
def divisor(n):
    i = 1
    table = []
    while i * i <= n:
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table
for i in divisor(a):
    i = int(i)
    b = a//i
    maxchecker = max(len(str(i)),len(str(b)))
    mini = min(maxchecker,mini)
print(mini)

Submission status: Accepted

Solution code:
n=int(input())
def g(x):
    z=0
    while x>=1:
        z+=1
        x=x//10
    return z
def f(a,b):
    return max(g(a),g(b))
i=1
ans=10**10
while i*i<=n:
    if n%i==0:
        ans=min(ans,f(i,n//i))
    i+=1
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

N = int(input())

def f(a,b):
    if len(str(a)) < len(str(b)):
        return len(str(b))
    else:
        return len(str(a))

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

Submission status: Accepted

Solution code:
import math

n = int(input())

def f(a, b):
  if len(str(a)) < len(str(b)):
    return len(str(b))
  else:
    return len(str(a))

ans = float('inf')
for i in range(1, int(math.sqrt(n)+1)):
  if n%i == 0:
    ans = min(ans, f(i, n//i))
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
lim = math.floor(math.sqrt(N))
f_min = len(str(N))
for i in range(1, lim + 1):
  if N % i == 0:
    B = int(N / i)
    if len(str(B)) < f_min:
      f_min = len(str(B))
print(f_min)

Submission status: Accepted

Solution code:
N = int(input())
M = int(pow(N,1/2))

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

Submission status: Accepted

Solution code:
N=int(input())

def divisor(n):
	i=1
	table=[]
	while i*i<=n:
		if n%i==0:
			table.append(n//i)
		i+=1
	num=min(table)
	ans=len(str(num))
	return ans
  
print(divisor(N))

Submission status: Accepted

Solution code:

N = int(input())
F = [100000000000, 1]

for a in range(1, int(N ** 0.5) + 1):
    if N % a == 0:
        b = int(N / a)
        f = [a, b]
        if max(len(str(f[0])), len(str(f[1]))) < max(len(str(F[0])), len(str(F[1]))):
            F = f

print(max(len(str(F[0])), len(str(F[1]))))

Submission status: Accepted

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

N = int(input())

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

print(ans)

Submission status: Accepted

Solution code:
from math import *

def func(x):
  ret_val=0
  while 0<x:
    x//=10
    ret_val+=1
  return ret_val

N=int(input())
ans=func(N)
for A in range(1,int(sqrt(N))+1):
  if N%A==0:
    B=N//A
    temp=max(func(A),func(B));
    ans=min(ans,temp)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
newN = int(math.sqrt(N))
for i in range(1,newN+1):
    if N%i == 0:
        A = i
        B = int(N/i)
print(len(str(B)))

Submission status: Accepted

Solution code:
import sys
# sys.setrecursionlimit(100000)


def input():
    return sys.stdin.readline().strip()


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


def make_divisors(n: int):
    lower_divs = []
    upper_divs = []
    i = 1
    while i**2 <= n:
        if n % i == 0:
            lower_divs.append(i)
            if i != n // i:
                upper_divs.append(n // i)
        i += 1
    return lower_divs + upper_divs[::-1]


def main():
    n = input_int()
    divs = make_divisors(n)
    ans = float("inf")
    for div in divs:
        a = div
        b = n // div
        if a * a <= n:
            ans = min(ans, max(len(str(a)), len(str(b))))
    print(ans)
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
bb = int(input())
mini = bb
aa = int(math.sqrt(bb))
for i in range(1,aa+1):
  if bb%i == 0:
    cc = int(bb/i)
    
    ans = len(str(cc))
    if ans < mini:
      mini = ans
print(mini)

Submission status: Accepted

Solution code:
import math
n = int(input())
a = 0
for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0:
        a = i
b = n//a
j = 0
while True:
    m = b / (10**j)
    if m>=1 and m<10:
        ans = j+1
        break
    j+=1

print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
if n < 10:
    print(1)
else:
    a = 0
    for i in range(1, int(math.sqrt(n))+1):
        if n % i == 0:
            a = i
    b = n//a
    j = 1
    while True:
        m = b / (10**j)
        if m>=1 and m<10:
            ans = j+1
            break
        j+=1

    print(ans)

Submission status: Accepted

Solution code:
import sys
from sys import exit
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def perm(n,mod=None):
    ans = 1
    for i in range(1,n+1):
        ans *= i
        if mod!=None:
            ans %= mod
    return ans
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    return C

def f(a,b):
    return max(div10(a),div10(b))

N=intput()
L=pf(N)
S=set([(1,N)])
for k in L:
    T=set()
    for i in range(1,L[k]+1):
        for s in S:
            T.add((s[0]*(k**i), s[1]//(k**i)))
    S=S|T
ans=INF
for a,b in S:
    ans=min(ans,f(a,b))
print(ans)