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:
N = int(input())

def count_digit(n):
    cnt = 1
    while True:
        n = n // 10
        if n == 0:
            break
        else:
            cnt += 1
    return cnt

def gcd(x,y):
    if x%y==0:
        return y
    else:
        return gcd(y, x%y)

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        # nを合う数字で割り切れたら、その割った数と商をリストに追加する。
        # nが平方数のとき、同じ数字が2回追加されてしまうので3行したのif文がある
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

divs_list = make_divisors(N)

min_f = 12
len_d = len(divs_list)
for i in range(len_d):
    if i > len_d-i:
        break
    cnt = max(count_digit(divs_list[i]),count_digit(divs_list[len_d-i-1]))
    if min_f > cnt:
        min_f = cnt
print(cnt)

Submission status: Accepted

Solution code:
N = int(input())

end = int(N ** (1/2)) + 1

for i in reversed(range(1,end)):
    if N % i == 0:
        ans_a = i
        ans_b = int(N / i)
        print(max(len(str(ans_a)), len(str(ans_b))))
        exit()

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

ans = 100000000000000000
for div in d:
    r = n//div
    temp = max(len(str(div)),len(str(r)))
    if ans > temp:
        ans = temp

print(ans)

Submission status: Accepted

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

divisors = []
i = 1
while i <= math.sqrt(N):
    if N % i == 0:
        divisors.append([i, int(N/i)])
    i += 1
ans = N
for i in divisors:
    if max(i) < ans:
        ans = max(i)

print(len(str(ans)))

Submission status: Accepted

Solution code:
from math import sqrt
N = int(input())
ans = float("inf")
for a in range(1, round(sqrt(N)) + 1):
    if N % a:
        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 = n
for a in range(1, n):
    if a * a > n:
        break
    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:
import math

N = int(input())

yakusu_pair =[]

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

min_f=12
for pair in yakusu_pair:
    f=int(math.log10(max(pair[0],pair[1])))+1
    if min_f>f:min_f=f

print(min_f)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import sqrt

N = int(input())
ans = len(str(N))
for i in range(1, int(sqrt(N))+1):
    if N % i == 0:
        B = N//i
        ans = min(ans, max(len(str(i)), len(str(B))))
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=make_divisors(n)
m=len(l)
ans=10**100
for i in range(min(m//2+1,m)):
    a,b=len(str(l[i])),len(str(n//l[i]))
    ans=min(ans,max(a,b))
print(ans)

Submission status: Accepted

Solution code:
# https://atcoder.jp/contests/abc057/tasks/abc057_c
# C - Digits in Multiplication

N = int(input().split()[0])
c = 0
for i in range(int(N ** (1/2)), 0, -1):
    if N % i == 0:
        a = int(N / i)
        d = (i, a)
        break

ans = len(str(max(d)))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
print(min([len(str(N//n)) for n in range(1, int(N**0.5) + 1) if N % n < 1]))

Submission status: Accepted

Solution code:
N = int(input())
ans = 10
for n in range(1, N+1):
    q, r = divmod(N, n)
    if n > q:
        break
    if r == 0:
        d = max(len(str(n)), len(str(q)))
        if ans > d:
            ans = d
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
sqrt_n = int(n ** 0.5)
ans = 10

for i in range(1, sqrt_n + 1):
    let = n // i
    if n % i == 0:
        if len(str(max(i, let))) < ans:
            ans = len(str(max(i, let)))
print(ans)

Submission status: Accepted

Solution code:
import math
N = int(input())
sqrt_N = int(math.sqrt(N))

ans = float('inf')
for i in range(1,sqrt_N+1):
  if N % i == 0:
    if ans > max(len(str(i)),len(str(int(N/i)))):
      ans = max(len(str(i)),len(str(int(N/i))))

print(ans)

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:
        l=len(str(n//i))
        ans=min(ans, l)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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)

ans = 10**10
for v in l:
    ans = min(ans, f(v, n//v))
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
import math
def F (a,b):
    a_len = len(str(a))
    b_len = len(str(b))
    return max(a_len,b_len)
result = 0
if n % 2 == 0:
    for i in range(2,int(math.sqrt(n))+1,2):
        if n % i == 0:
            result = len(str(n//i))
else:
    for j in range(1,int(math.sqrt(n))+1,2):
        if n % j == 0:
            result = len(str(n//j))
print(result)

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 F(a, b):
    return max(len(str(a)), len(str(b)))


ans = []
for n in make_divisors(N):
    n2 = N // n
    ans.append(F(n, n2))
print(min(ans))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

res = len(str(n))
for a in range(1,n+1):
	if a * a > n:
		break
	if n%a != 0:
		continue
	b = n//a
	ans = max(len(str(a)), len(str(b)))
	if ans < res:
		res = ans

print(res)

Submission status: Accepted

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

    divisors.sort()
    return divisors

n=int(input())
l=make_divisors(n)
print(len(str(l[len(l)//2])))

Submission status: Accepted

Solution code:
import math
def main():
    ans = float('inf')
    N = int(input())
    for i in range(1, int(math.sqrt(N))+1):
        if N % i == 0:
            ans = min(ans, max(len(str(i)), len(str(N//i))))
    return ans


if __name__ == '__main__':
    print(main())

Submission status: Accepted

Solution code:
N = int(input().strip())

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

print(sorted([F(n,N//n) for n in range(1, int(2+N**0.5)) if N % n == 0])[0])

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(len(f)):
    digit_num.append(max(len(str(f[i][0])),len(str(f[i][1]))))

print(min(digit_num))

Submission status: Accepted

Solution code:
n = int(input())

a =  n**0.5//1
num = 0

while a-num>=2:
    if n%(a-num) == 0:
        break
    num += 1

def keta(b):
    c = 1
    while b/10**c >=1:
        c += 1
    return c
    
print(max(keta(a-num),keta(n/(a-num))))

Submission status: Accepted

Solution code:
import math
number = int(input())
ruijou = int(math.sqrt(number))
check = 0
count = 0
result =100000000000

for i in range(1,int(ruijou)+1):
    if number % i == 0:
        check = int(number / i)
        while not check == 0:
            check = int(check / 10)
            count += 1
        if count < result :
            result = count
    count = 0
print(result)

Submission status: Accepted

Solution code:
N = int(input())
r = 100
for A in range(1, min(N, 100000)+1):
  if N%A != 0:
    continue
  B = N//A
  d = max(len(str(A)), len(str(B)))
  r = min(r, d)
print(r)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

sq = int(N ** 0.5) + 1

f = []
for i in range(1, sq):
    if N % i == 0:
        f.append((i, N // i))

ans = N
for a, b in f:
    ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

pairs = []
i = 1
while (i * i) <= n:
    if 0 == n % i:
        pairs.append([i, int(n / i)])
    i += 1

ans = 10000000000
for pair in pairs:
    a = len(str(pair[0]))
    b = len(str(pair[1]))
    ans = min(ans, a if a > b else b)
print(ans)

Submission status: Accepted

Solution code:
import sys
input=sys.stdin.readline
n=int(input())
i=1
while i**2<=n:
    if n%i==0:
        x=n//i
        count=1
        while not x<10:
            x=x/10
            count+=1
        ans=count
    i+=1
print(ans)

Submission status: Accepted

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

if __name__ == '__main__':
    N = int(input())
    val = len(str(N))
    li = []
    for i in range(1, math.ceil(math.sqrt(N))+1):
        if N % i == 0:
            a = len(str(int(i)))
            b = len(str(int(N/i)))
            c = max(a, b)

            if c < val:
                val = c

    print(val)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
def keta(n):
    r = 1
    _n = n
    while _n != 0 :
        _n = _n // 10
        if _n > 0:
            r +=1
    return r
n = int(input())
r = keta(n)
for a in range(1, int(math.sqrt(n))+1):
    b = n / a
    if n % a == 0:
        r = min(r, max(keta(a), keta(b)))
print(r)

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin

def na(): return map(int, stdin.readline().split())

def ns(): return stdin.readline().strip()

n = int(ns())
i = 1
mi = n
while i*i <= n:
    if n % i == 0:
        x = n // i
        mi = min(mi, x)
    i += 1
print(len(str(mi)))

Submission status: Accepted

Solution code:
import bisect
import heapq
import itertools
import math
import operator
import os
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


def get_divisors(n):
    """
    n の約数をリストで返す
    :param int n:
    :rtype: list of int
    """
    ret = []
    for i in range(1, int(math.sqrt(n)) + 1):
        if n % i == 0:
            ret.append(i)
            if n // i != i:
                ret.append(n // i)
    return ret


N = int(sys.stdin.readline())
ans = IINF
for d in get_divisors(N):
    c = N // d
    f = max(len(str(c)), len(str(d)))
    ans = min(ans, f)
print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
import math
INF = float("inf")


def divisors_pair(n):
    ret_A = []
    ret_B = []
    for i in range(1, int(n ** 0.5) + 1):
        d, m = divmod(n, i)
        if m == 0:
            ret_A.append(i)
            ret_B.append(d)
    return ret_A, ret_B


def solve(N: int):
    A, B = divisors_pair(N)
    m = INF
    for a, b in zip(A, B):
        curr = max(len(str(a)), len(str(b)))
        m = min(m, curr)
    print(m)
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(n):
  a = 1
  while True:
    b, m = n // a, n % a
    if b < a:
      break
    if m == 0:
      yield b
    a += 1

n = int(input())
ans = len(str(n))
for b in f(n):
  ans = min(ans, len(str(b)))

print(ans)

Submission status: Accepted

Solution code:
N=int(input())
jN=N**0.5
for i in range(int(jN),0,-1):
    j=N/i
    if j==int(j):
        ans=max(i,j)
        break
c=0
while ans >0:
    c+=1
    ans//=10
print(c)

Submission status: Accepted

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

N = int(input())

ans = float('inf')

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())

a = 1
i = 2
while i * i <= N:
    if N % i == 0:
        a = i
    i += 1

b = N // a
print(max(len(str(a)), len(str(b))))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
N = int(input())
M = 0
for i in range(math.floor(N ** 0.5)):
    if N % (i + 1) == 0:
        M = i + 1
print(str(max(len(str(M)), len(str(N//M)))))

Submission status: Accepted

Solution code:
import math

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

N = int(input())

ans = len(str(N))
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:
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush, heapify
import math
import itertools
import random
 
# NO, PAY-PAY
#import numpy as np
#import statistics
#from statistics import mean, median,variance,stdev
 
INF = float('inf')
def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))
 
def main():
    N = inputInt()
    yakusuu = make_divisors(N)
    
    ans = INF
    for i,val in enumerate(yakusuu):
        for j,vol in enumerate(yakusuu):
            if val*vol == N:
                tmp = max(val,vol)
                tmptmp = len(str(tmp))
                
                if ans > tmptmp:
                    ans = tmptmp
                    
    print(ans)
    
    
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
    
if __name__ == "__main__":
	main()

Submission status: Accepted

Solution code:
#%%

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

    # divisors.sort()
    return divisors

N = int(input())
l = make_divisors(N)

ans = 100
for i in range(len(l)):
    a = l[i]
    b = N//l[i]
    tmp = max(len(str(a)), len(str(b)))
    if tmp < ans :
        ans = tmp

print(ans)
    


#%%


#%%

Submission status: Accepted

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

min = len(str(N))
for a in range(2, int(math.sqrt(N))+1):
    if len(str(int(N/a))) < min and N % a == 0:
        min = len(str(int(N/a)))

print(min)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

def factor(n):
    factList = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            factList.append(i)
            factList.append(n // i)
        i += 1

    factList.sort()
    return factList

fact = factor(N)

ans = float('inf')
for i in range(len(fact)):
    f = max(len(str(fact[i])), len(str(fact[-1 - i])))
    ans = min(ans, f)

print(ans)

Submission status: Accepted

Solution code:
N = long(raw_input())
def dig(A,B):
        if A > B:
                return A
        else:
                return B
A = 0
B = 0 
X = []
i = long(1)
while N >= A*A:
        A = long(i)
        if N%i == 0:
                B = long(N/i)
                X.append(dig(A,B))
        if A in X:
                break
        i+=1
print len(str(min(X)))

Submission status: Accepted

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

min_f = float('inf')

for i in range(1, m+1):
  x = n/i
  if x.is_integer():
    x = int(x)
    i = int(i)
    f = max(len(str(i)), len(str(x)))
    if min_f > f:
      min_f = f
print(min_f)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math

def F(x, y):
    tmp = max(x, y)
    ans = 0
    while tmp != 0:
      tmp = tmp // 10
      ans += 1
      #print(tmp)
    
    return ans
  
n = int(input())

keta = F(0, n)

#print ( int(math.sqrt(n))+1 )

for i in range(1,int(math.sqrt(n))+1,1):
  if n % i == 0:
    tmp = F( n / i, i )
    if tmp < keta:
      keta = tmp

print( keta )

Submission status: Accepted

Solution code:

import collections
import itertools
import sys

def getint(): return int(input())
def getints(): return list(map(int, input().split()))

def get_divisor(n):
    if n == 1:
        return [1]
    res = []
    for i in range(1, n):
        if i * i > n:
            break
        if n % i == 0:
            res.append(i)
            if i != n // i:
                res.append(n//i)
    return res

n=getint()
divs=get_divisor(n)
res = 10
for d1 in divs:
    d2 = n // d1
    tmp = max(len(str(d1)), len(str(d2)))
    res = min(res, tmp)

print(res)

Submission status: Accepted

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

Submission status: Accepted

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


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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
n = int(input())
min_len = 10**11
for a in range(1,int(math.sqrt(n))+1):
  b = (n//a)
  if a * b == n:
    tmp = max(len(str(a)), len(str(b)))
    if tmp < min_len:
      min_len = tmp
print(min_len)

Submission status: Accepted

Solution code:
import numpy as np
N = int(input())
lim = int(np.sqrt(N)) + 1
p = []
for i in range(1,lim):
    if N % i == 0:
        p.append(int(N / i))
st = str(p[-1])
print(len(st))

Submission status: Accepted

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

ans = []
for i in range(half, 0, -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())
divisor_list = []

for i in range(1, int(n**0.5)+1):
    if n % i == 0:
        divisor_list.append(i)

a = max(divisor_list)
b = int(n/a)

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

Submission status: Accepted

Solution code:
n = int(input())

a = 1
b = 1
i = 2
while i*i <= n:
    if n % i == 0:
        a = i
    i += 1

b = n // a

print(max(len(str(a)), len(str(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:
            x = i
            if i != n // i:
                y = n // i
            else:
                y = i
            divisors.append([x,y])
    return divisors


n = int(input())
lst = make_divisors(n)
ans = 10**9
for l in lst:
    a = len(str(l[0]))
    b = len(str(l[1]))
    ans = min(ans,max(a,b))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools


def solve(N: int):
    a = math.floor(math.sqrt(N))
    mn = N
    for aa in range(1, a+1):
        if N % aa == 0:
            k = math.floor(math.log10(N // aa)) + 1
            mn = min(mn, k)
    print(mn)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())

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

n2 = int(n ** 0.5)
ans = 10 ** 11

for i in range(1, n2+1):
  if n % i == 0:
    t = n // i
    ans = min(ans, f(i, t))

print(ans)

Submission status: Accepted

Solution code:
import math
n = int(input())
r = int(math.sqrt(n))
arr = []
for i in range(1,r+1):
  b = n / i
  if b.is_integer():
    arr.append(max(len(str(i)),len(str(int(b)))))
print(min(arr))

Submission status: Accepted

Solution code:
from math import sqrt, ceil

def check(n):
    minf = len(str(n))
    square = ceil(sqrt(n)) # 10^5
    for a in range(1, square+1):
        b, r = divmod(n, a)
        if r == 0:
            f = max(len(str(a)), len(str(b)))
            minf = min(f, minf)
    return minf

#print(check(10**10))
N = int(input())
print(check(N))

Submission status: Accepted

Solution code:
n = int(input())

s = (n**0.5) + 1

li = []

for i in range(1, int(s+1)):
    if n%i == 0:
        li.append(i)
        li.append(n//i)
        
print(max(len(str(li[-1])), len(str(li[-2]))))

Submission status: Accepted

Solution code:
import math

N = int(input())

ans = 11

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

print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
last = N
for num in range(1, N+1):
  if num**2 > N:
    print(len(str(last)))
    break
  elif num**2 == N:
    print(len(str(num)))
    break
  else:
    if N%num == 0:
      last = N//num

Submission status: Accepted

Solution code:
#### import ####
import sys
sys.setrecursionlimit(10**7)
import math
from collections import defaultdict

#### 定数 ####
mod = 10**9 + 7

#### 読み込み ####
def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N):
  read_all = [tuple(map(int, input().split())) for _ in range(N)]
  return map(list,zip(*read_all))

#################

N = I()
ans = 11
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:
import math
from sys import exit, stdin
N = int(stdin.readline().rstrip())
ans = 0
for i in range(int(math.sqrt(N)), 0, -1):
    if N % i == 0:
        ans = N // i
        break
print(len(str(ans)))

Submission status: Accepted

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

Submission status: Accepted

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


def main():
    N = int(input())
    ans = float('INF')
    for i in range(1, int(N ** 0.5) + 1):
        if N % i == 0:
            ans = min(ans, f(i, N // i))
    print(ans)


main()

Submission status: Accepted

Solution code:
import math

N = int(input())

d=[]

for i in range(1,int(math.sqrt(N))+1):
    if N%i == 0:
        d.append(N//i)
        d.append(i)
    
Fmin=10**10

for i in d:
    if N%i ==0:
        A = i
        B = N//i
        F = max(len(str(A)),len(str(B)))
        if F < Fmin:
            Fmin = F
print(Fmin)

Submission status: Accepted

Solution code:

import itertools
from collections import Counter
from collections import defaultdict
import bisect
from heapq import heappush, heappop

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

    ans = len(str(n))
    i = 1
    while i * i <= n:
        if n % i == 0:
            a = i
            b = n // i
            ans = min(ans, max(len(str(a)), len(str(b))))

        i += 1

    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

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

#print(a,b)
calc_F = max(len(str(a)),len(str(b)))
print(calc_F)

Submission status: Accepted

Solution code:
import math

N = int(input())

tmp = int(math.sqrt(N)) + 1

for n in range(1, tmp+1):
    if N % n == 0:
        a = N//n
print(len(str(a)))

Submission status: Accepted

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

Submission status: Accepted

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

    divisors.sort()
    return divisors


n = int(input())
div = make_divisors(n)
if len(div) % 2 == 0:
    print(len(str(div[int(len(div) / 2)])))
else:
    print(len(str(div[int(len(div) / 2)])))

Submission status: Accepted

Solution code:
import math
n = int(input())
s = math.ceil(math.sqrt(n))
tmp = []
for i in range(2,s+1):
    if n%i == 0:
        m = max(i, n//i)
        tmp.append(int(math.log10(m))+1)
if len(tmp) == 0:
    print(int(math.log10(n))+1)
else:
    print(min(tmp))

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(max(len(str(i)),len(str(n//i))));break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n =int(input())
    a = 0
    for i in range(int(n**0.5//1),0,-1):
        if n%i ==0:
            a = i
            break
    ans = str(n//a)
    print(len(ans))
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())

ret = float('inf')
i = 1
while i * i <= N :
    if N % i == 0 :
        ret = min(ret, len(str(N//i)))
    i += 1
print(ret)

Submission status: Accepted

Solution code:
import math

n = int(input())
cd = []
for i in range(int(n ** 0.5)):
    if n % (i + 1) == 0:
        cd.append(i + 1)
a = max(cd)
b = n // a
print(int(math.log10(b)) + 1)

Submission status: Accepted

Solution code:
N = int(input())
ans = 10
for i in range(1,int(N**(1/2))+1):
  if N%i == 0:
    j = N//i
    k = 0
    while j//(10**k) > 0:
      k += 1
    ans = min(ans,k)
print(ans)

Submission status: Accepted

Solution code:
def smaller(x, y):
	if x < y:
		return x
	return y
def larger(x, y):
	if x > y:
		return x
	return y

prime = []
numberlist = []
for i in range(2, 100001):
	numberlist.append(i)
while numberlist[0] <= 316:
	now = numberlist.pop(0)
	prime.append(now)
	newnumberlist = []
	for i in range(0, len(numberlist)):
		if numberlist[i] % now != 0:
			newnumberlist.append(numberlist[i])
	numberlist = newnumberlist
prime = prime + numberlist

N = int(input())
M = N
countlist = []
for i in range(0, len(prime)):
	countlist.append(0)
for i in range(0, len(prime)):
	while N % prime[i] == 0:
		countlist[i] += 1
		N //= prime[i]
numberlist = [1]
for i in range(0, len(prime)):
	genlist = [1]
	for j in range(0, countlist[i]):
		genlist.append(prime[i]*genlist[-1])
	newnumberlist = []
	for j in range(0, len(genlist)):
		for k in range(0, len(numberlist)):
			newnumberlist.append(genlist[j]*numberlist[k])
	numberlist = newnumberlist
min = 5000000000000000
for i in range(0, len(numberlist)):
	min = smaller(min, larger(len(str(M//numberlist[i])), len(str(numberlist[i]))))
print(min)