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

n = int(input())
ans_list = []

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

print(min(ans_list))

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())

def make_divisors(n):
    i = 1
    lowest = 10**18
    while i*i <= n:
        if n % i == 0:
            lower_divisor = i
            upper_divisor = n//i
        i += 1
    return len(str(upper_divisor))
    
print(make_divisors(N))

Submission status: Accepted

Solution code:
N = int(input())

if N == 1:
    print(1)
    exit()

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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]

N = int(input())
A = make_divisors(N)
ans = float("inf")
#print(A)
if len(A)%2 == 0:
  mid = len(A)//2
else:
  mid = len(A)//2 + 1
for i in range(mid):
  temp = max(len(str(A[i])),len(str(A[-1-i])))
  ans = min(ans,temp)
print(ans)

Submission status: Accepted

Solution code:
N = int(input())

ans = 999999
m = 1
while m*m <= N:
    if N%m == 0:
        n = N//m
        t = max(len(str(n)), len(str(m)))
        ans = min(ans, t)
    m += 1
print(ans)

Submission status: Accepted

Solution code:
def main():
    def f(a, b):
        sa = str(a)
        sb = str(b)
        return max(len(sa), len(sb))
    N = int(input())
    ans = 10**12
    for i in range(1, N+1):
        if N < i*i:
            break
        if N % i != 0:
            continue
        b = N//i
        ans = min(ans, f(i, b))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
from math import log10

N = int(input())

ans = int(log10(N)) + 1

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

print(ans)

Submission status: Accepted

Solution code:
from math import log10
n = int(input())
ans = int(log10(n)) + 1
for i in range(2, int(n ** 0.5) + 1):
    if n % i == 0:
        temp = int(log10(n // i)) + 1
        if temp < ans:
            ans = temp
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(ans,len(str(b)))
print(ans)

Submission status: Accepted

Solution code:
N = int(open(0).read())
 
ans = len(str(N))
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:
N = int(open(0).read())

ans = len(str(N))
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:
n, m = int(input()), 0
for i in range(1, int(n**.5) + 1):
  if n%i == 0:
    m = max(m, i)
print(len(str(n // m)))

Submission status: Accepted

Solution code:
import math

n = int(input())
i = 1
ans = 100000000000
while i <= math.sqrt(n):
    if n%i == 0:
        a = n//i
        b = i
        temp = max(len(str(a)), len(str(b)))
        ans = min(ans, temp)
    i+=1
print(ans)

Submission status: Accepted

Solution code:
import math
def count_digits(n):
	res = 0
	while n:
		n = n//10
		res = res+1
	return res
n = int(input())
i =1
ans = 11
while i<=math.sqrt(n):
	if n%i==0:
		a= n//i
		b=i
		u = count_digits(a)
		v =count_digits(b)
		ans = min(ans, max(u,v))
	i=i+1
print(ans)

Submission status: Accepted

Solution code:
# from pprint import pprint
import math

# import collections

n = int(input())


# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))


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


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0 and f(a, n // a) <= ans:
        ans = f(a, n // a)
    a += 1

print(ans)

Submission status: Accepted

Solution code:
# from pprint import pprint
import math

# import collections

n = int(input())


# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))


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


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0 and f(a, n // a) <= ans:
        # print('test', a, n // a, f(a, n // a))
        ans = f(a, n // a)
    a += 1

print(ans)

Submission status: Accepted

Solution code:
import math

n = int(input())
set = []
i = 1
ans = []

t = n**0.5
if len(str(t)) <=8:
    print(len(str((math.floor(t)))))
else:
    while i*i <= n:
        cc = []
        pre = []
        if n % i == 0:
            pre.append(i)
            cc.append(len(str(i)))
            if i != n // i:
                pre.append(n//i)
                cc.append(len(str(n//i)))
                if cc == []:
                    continue
                else:
                    ans.append(pre)
                    result = abs(cc[0]-cc[1])
                    set.append(result)

        i += 1


    min = set.index(min(set))
    print(len(str((max(ans[min])))))

Submission status: Accepted

Solution code:
def div(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]

n = int(input())
ans = float("Inf")
lis = div(n)
y = 1
for x in lis:
    z = n//x
    ans = min(ans, max(len(str(z)), len(str(x))))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())

MAXN = 10 ** 5


def answer():
    minf = 10
    for a in range(1, MAXN + 1):
        if n % a == 0:
            b = n // a
            f = max(len(str(a)), len(str(b)))
            minf = min(minf, f)
    return minf


print(answer())

Submission status: Accepted

Solution code:
n = int(input())

min_count = len(str(n))
for i in range(1, int(n**0.5) + 1):
  if n % i == 0:
    a = i
    b = int(n / i)
    if len(str(a)) < len(str(b)):
      count = len(str(b))
    else:
      count = len(str(a))
    if count < min_count:
      min_count = count
print(min_count)

Submission status: Accepted

Solution code:
import math
n = int(input())
for i in range(int(n**0.5),0,-1):
    if n%i == 0:
        a = max(i,n//i)
        print(int(math.log10(a))+1)
        break

Submission status: Accepted

Solution code:
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
from collections import defaultdict
sys.setrecursionlimit(10**7)
import math
#from itertools import product, accumulate, combinations, product
#import bisect# lower_bound etc
#import numpy as np
#from copy import deepcopy
#from collections import deque

class factorials:
    '''
    args:
      n : max val when exploring factorials
    '''
    def __init__(self, n):
        self.n = 1
        self.factorials = []
        self.update(n)

    def update(self, n):
        if self.n >= n:
            return None
        for i in range(self.n+1, n+1):
            done = False
            limit = int(i ** 0.5)
            for j in self.factorials:
                if j > limit: break
                if not i % j:
                    done = True
                    break
            if not done:
                self.factorials.append(i)
        self.n = n
        return None

    def lists(self):
        return self.factorials

    def check_fact(self, x):
        if x > self.n**2:
            self.update(int(x ** 0.5)+1)
        for f in self.factorials:
            if not x % f:
                return False
        return True

def prod(lis):
    ret = []
    def f(l, product):
        #print(l)
        if not l:
            ret.append(product)
            return None
        for k in l[0]:
            f(l[1:], product + [k])

    f(lis, [])
    return ret

def run():
    N = int(input())
    ori = N
    FACT = factorials(int(N ** 0.5))
    dissociated = defaultdict(lambda:0)
    for f in FACT.lists():
        while not N % f:
            dissociated[f] += 1
            N = N // f
    if N != 1:
        dissociated[N] += 1

    val_dic = {}
    lis = []
    facts = []
    for key in dissociated.keys():
        facts.append(key)
        lis.append(list(range(dissociated[key]+1)))

    products = prod(lis)
    ans = 1 << 50
    for p in products:
        S = 1
        for i, v in enumerate(p):
            S *= facts[i] ** v
        S = max(ori // S, S)
        ans = min(ans, S)

    print(math.floor(math.log10(ans))+1)
    #print(facts, products)
    #print(dissociated)
    #print(lis)


    #print(factorials)
if __name__ == "__main__":
    run()

Submission status: Accepted

Solution code:
n = int(input())

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

res = float('inf')
for a, b in l:
    res = min(res, max(len(str(a)), len(str(b))))

print(res)

Submission status: Accepted

Solution code:
import math

n = int(input())
min_value = 10 ** 9

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())

A_start = int(N**0.5)

for A in range(A_start, 0, -1):
    if N % A != 0:
        continue
    B = N // A
    print(len(str(B)))
    break

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
n=int(input())

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


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

    lower.extend(reversed(upper))
    return lower


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

    divs = divisors(N)
    ans = INF
    for d in divs[: (len(divs) + 1) // 2]:
        ans = min(ans, max(len(str(d)), len(str(N // d))))

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    from math import sqrt
    N=int(input())
    sqrtN=int(sqrt(N))
    div=[d for d in range(1,sqrtN+1) if N%d==0]
    ans=100
    for d in div:
        e=0
        for e in range(12):
            if (N//d)<10**e:
                ans=min(ans,e)
    print(ans)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
import itertools,collections
def make_divisors(n):
    divisors = []
    func = []
    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)
                func.append(len(str(n//i)))
            else:
                func.append(len(str(i)))

    divisors.sort()
    return func
def main():
    n = int(input())
    div = make_divisors(n)
    print(min(div))

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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]

def main():
    n=int(input())
    m=make_divisors(n)
    a=10**10
    for i in m:
        if n//i < i:
            break
        else:
            a=min(a, f(i, n//i))
    print(a)
                
if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    import sys

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

    n = int(input())
    i = 1
    ans = 13
    while i*i <=n:
        if n%i == 0:
            tmp = max(len(str(i)), len(str(n//i)))
            ans = min(tmp, ans)
        i +=1 
    print(ans)
        
    
    
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
"""
全探索
N<=1e10なのでa<=math.sqrt(N)まで調べればよい
"""
import math
n = int(input())
mn = 1e10
for a in range(1,int(math.sqrt(n))+1) :
    if n%a == 0 :
        b = str(n//a)
        a = str(a)
        mn = min(mn,max(len(a),len(b)))
print(mn)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 8)

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

    i = 1
    ans = 15
    while i*i <= N:
        if N%i==0:
            # bのほうが必ず大きくなる
            a = i
            b = N//i
            ans = min(ans,len(str(b)))
        i += 1

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

Submission status: Accepted

Solution code:
n = int(input())
#桁数
def keta(x):
    count = 0
    while x != 0:
        count += 1
        x //= 10
    return count

#素数判定
ans = 1
ch = 0
for i in range(2,int(n**0.5)+1):
    if n%i == 0: #素数でない
        ans = max(ans,i)
        ch += 1
if ch == 0:
    print(keta(n))
    exit()

a = ans
b = n//a
ans = max(keta(a),keta(b))
print(min(ans, keta(n)))

Submission status: Accepted

Solution code:
import math,sys

N = int(input())

max = math.ceil(N**0.5)
#print(max)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# 整数の入力
n = int(input())

def f(a, b):
    #print("a: {}, b:{}".format(a, b))
    digit_a = 0
    while(a > 0):
        digit_a += 1
        a //= 10
    #print("digit_a:{}".format(digit_a))
    digit_b = 0
    while(b > 0):
        digit_b += 1
        b //= 10
    #print("digit_b:{}".format(digit_b))
    if digit_a < digit_b:
        return digit_b
    else:
        return digit_a

#約数列挙
def resolve(n):
    min = 10 ** 10
    for i in range(1, int(n ** 0.5)+1):
        if n % i == 0:
            if i != n//i:
                b = n//i
            else:
                b = i
            temp = f(i, b)
            if min > temp:
                min = temp

    print(min)

#print("n: {}".format(n))
resolve(n)

Submission status: Accepted

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

while N%n:
  n-=1

print(len(str(N//n)))

Submission status: Accepted

Solution code:
N = int(input())
a = 100

for n in range(1,1+10**5):
  if N%n==0:
    a = min(a,max(len(str(n)),len(str(N//n))))

print(a)

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)))
        exit()
print(len(str(n)))

Submission status: Accepted

Solution code:
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

if __name__ == '__main__':
	
	n = int(input())

	#n = a * b のためnの約数を求める
	A = divisor(n)

	B = []
	c_tmp = 11
	
	for i in A:
		tmp = n // i
		#tmp i の桁数をチェック
		c1 = len(str(tmp))
		c2 = len(str(i))
		c2_tmp = max(c1,c2)
		c_tmp = min(c2_tmp,c_tmp)

	print(c_tmp)

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import sqrt, ceil, log10
def main():
    n = int(input())
    sqrtn = ceil(sqrt(n))
    r = n
    for i1 in range(1, sqrtn + 1):
        if n % i1 == 0:
            t1 = log10(i1)
            t2 = log10(n//i1)
            t = max(t1, t2) + 1
            r = min(r, t)
    print(int(r))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import math

n = int(input())
l = []
for i in range(1, int(math.sqrt(n)) + 1):
    if n % i == 0:
        a = len(str(int(n / i)))
        b = len(str(int(i)))
        l.append(max(a, b))

print(min(l))

Submission status: Accepted

Solution code:
import math
N = int(input())
for i in range(1,int(math.sqrt(N))+1):
    if N % i == 0:
        ans = math.log10(N // i) // 1 + 1
print(int(ans))

Submission status: Accepted

Solution code:
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

n = i()

m = float("Inf")
for i in range( 1,int(n**(1/2))+1 ):
	if n%i == 0:
		note = len(str(max(i,n//i)))
		if note < m:
			m = note
print(m)

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 math

N=int(input())

L=int(math.sqrt(N))

for a in range(L+1,0,-1):
    if N%a==0:
        ans1=len(str(a))
        ans2=len(str(str(N//a)))
        print(max(ans1,ans2))
        exit()

Submission status: Accepted

Solution code:
N=int(input())

L=int(N**0.5)

for a in range(L+1,0,-1):
    if N%a==0:
        ans1=len(str(a))
        ans2=len(str(N//a))
        print(max(ans1,ans2))
        exit()

Submission status: Accepted

Solution code:
N=int(input())

L=int(N**0.5)

for a in range(L,0,-1):
    if N%a==0:
        ans1=len(str(a))
        ans2=len(str(str(N//a)))
        print(max(ans1,ans2))
        exit()

Submission status: Accepted

Solution code:
N=int(input())

L=int(N**0.5)

for a in range(L+1,0,-1):
    if N%a==0:
        ans1=len(str(a))
        ans2=len(str(str(N//a)))
        print(max(ans1,ans2))
        exit()

Submission status: Accepted

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

ans=float('inf')
for a,b in l:
  ans=min(max(len(str(a)),len(str(b))),ans)
print(ans)

Submission status: Accepted

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

ans = 100
sq_n = int(sqrt(N))
for i in range(1, sq_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 sys
import math
input = lambda: sys.stdin.readline()
exec("try:sys.stdin=open('input.txt','r');sys.stdout=open('output.txt','w')\nexcept:pass")

length = lambda x: len(str(int(x)))

n = int(input())
ans = []
for i in range(1, int(math.sqrt(n)) + 1):
    if n % i == 0:
        if n // i == i:
            ans.append(length(n // i))
        else:
            ans.append(max(length(i), length(n // i)))
print(min(ans))

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
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 lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def make_divisors(n: int) -> list:
    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

def main():
    n = i_input()

    num_list = make_divisors(n)

    print(len(str(num_list[len(num_list)-1])))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
sqrt = pow(N, 0.5)
ans = 10**10

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

Submission status: Accepted

Solution code:
# coding: utf-8
import math
N = int(input())


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

print(saisho)

Submission status: Accepted

Solution code:
import math

n = int(input())
i = [i for i in range(1, int(math.sqrt(n)) + 1) if n % i == 0][-1]
print(len(str(max(i, n // i))))

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
import math
def resolve():
    n = int(input())
    ans = len(str(n))
    MAX = int(math.sqrt(n))

    for a in range(1, MAX + 1):
        if n % a != 0:
            continue
        b = int(n / a)
        tmp = max(len(str(a)), len(str(b)))
        ans = min(ans, tmp)

    print(ans)
    return

resolve()

Submission status: Accepted

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

rootN = math.ceil(math.sqrt(N))

for A in range(1, rootN+1):
  if N % A == 0:
    B = int(N / A)
    ans.add(max(len(str(A)), len(str(B))))
  else:
    pass
print(min(ans))

Submission status: Accepted

Solution code:
N = int(input())
l = []
for a in range(1, 10**5+1):
  if N % a == 0:
    b = N // a
    s = max(len(str(a)), len(str(b)))
    l.append(int(s))
print(min(l))

Submission status: Accepted

Solution code:
n = int(input())

ans = 0
for i in list(range(1,int(n**0.5)+1))[::-1]:
    if n%i == 0:
        print(len(str(i)) if i > n/i else len(str(n//i)))
        exit()
print(len(str(n)))

Submission status: Accepted

Solution code:
from math import sqrt, floor
N = int(input())

# 素因数分解

left = []
right = []
for i in range(1, floor(sqrt(N)) + 1):
    if (N % i == 0):
        left.append(i)
        right.append(N // i)
    else:
        continue

last_left = str(left[-1])
last_right = str(right[-1])

ans = []
for i in range(len(left) - 1, -1, -1):
    ans.append(max(len(str(left[i])), len(str(right[i]))))

print(min(ans))

Submission status: Accepted

Solution code:
from math import sqrt
n = int (input())
nsqrt = int(sqrt(n))
for i in range(nsqrt, 0, -1):
    if n % i == 0:
        b = n // i
        a = i
        break
    if i == 1:
        b = 1
        a = n
def digits(n):
    ans = 0
    while n > 0:
        ans += 1
        n //= 10
    return ans
print (max(digits(a), digits(b)))

Submission status: Accepted

Solution code:
N = int(input())
P = [i for i in range(1, int(N**.5)+1)][::-1]
for i in P:
  if N%i == 0:
    print(len(str(N//i)))
    break

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())

ans = 10**18

for i in range(1, int(N**0.5)+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:
import math as ma
N = int (input ())
n = ma.floor(int(ma.sqrt(N)))
while 1 < n+1:
  if (N/n)%1 == 0:
    x = str(N/n)
    print (len(x)-2)
    break
  else:
    n -= 1

Submission status: Accepted

Solution code:
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n = INT()

i = 1
while i * i <= n:
    if n % i == 0:
        ans = len(str(n//i))
    i += 1
print(ans)

Submission status: Accepted

Solution code:
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

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

    if temp != 1:
        arr.append([temp, 1])

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

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        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 -self.parents[self.find(x)]

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

    def members(self, x):
        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()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
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


inf = 10 ** 18
mod = 10 ** 9 + 7

n = ir()
if n == 1:
    print(1)
    sys.exit()
tmp = make_divisors(n)
leng = len(tmp)
ans = 0
if leng%2 == 0:
    ans = max(len(str(tmp[leng//2-1])), len(str(tmp[leng//2])))
else:
    ans = len(str(tmp[leng//2]))
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# 53
import math
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


INF = float('inf')


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]


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


n = I()
divs = make_divisors(n)
divs = [elem for elem in divs if elem <= math.sqrt(n)]
ans = f(divs[0], n // divs[0])
for i in divs:
    ans = min(ans, f(i, n // i))
print(ans)