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: Wrong Answer

Solution code:
n = int(input())

ans = n
for i in range(1, int(n/2)+1):
  if n % i == 0:
    a, b = i, int(n/i)
    print(a, b)
    if a > b:
      break
    
    f = max( len(str(a)), len(str(b)) )
    #print(f)
    ans = min(ans, f)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())

def factorize(n):
    fct=[]
    b,e=2,0
    while b*b<=n:
        while n%b==0:
            n=n//b
            e=e+1
        if e>0:
            fct.append((b,e))
        b,e=b+1,0
    if n>1:
        fct.append((n,1))
    return fct

l=factorize(n)

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

ans=100
k=1
for i in range(len(l)):
    for j in range(l[i][1]):
        k*=l[i][0]
        ans=min(ans,f(k,n//k))

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

def factorize(n):
    fct=[]
    b,e=2,0
    while b*b<=n:
        while n%b==0:
            n=n//b
            e=e+1
        if e>0:
            fct.append((b,e))
        b,e=b+1,0
    if n>1:
        fct.append((n,1))
    return fct

l=factorize(n)

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

ans=100
k=1
for i in range(len(l)):
    for j in range(l[i][1]):
        k*=l[i][0]*(j+1)
        ans=min(ans,f(k,n//k))

print(ans)

Submission status: Wrong Answer

Solution code:
import math


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


N = int(input())
answer = len(str(N))
for A in range(1, int(math.sqrt(N))):
    if N % A == 0:
        B = N // A
        answer = min(answer, F(A, B))
print(answer)

Submission status: Wrong Answer

Solution code:
import math

def alldiv(x):
    div = [[1,x]]
    for i in range(2,math.floor(math.sqrt(x))+1):
        if x % i == 0:
            div.append([i, x//i])
    return div


def digit(N):
    d = 0
    while(N > 0):
        N //= 10
        d += 1
    return d


N = int(input())
div = alldiv(N)
print(div)
F = [max(digit(i[0]),digit(i[1])) for i in div]
print(min(F))

Submission status: Wrong Answer

Solution code:
import math

def alldiv(x):
    div = [[1,x]]
    for i in range(2,math.floor(math.sqrt(x))):
        if x % i == 0:
            div.append([i, x//i])
    return div


def digit(N):
    d = 0
    while(N > 0):
        N //= 10
        d += 1
    return d


N = int(input())
div = alldiv(N)
F = [max(digit(i[0]),digit(i[1])) for i in div]
print(min(F))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

def factor(x):
    ind = []
    for i in range(2,x+1):
        if x == 1:
            break
        elif x % i > 0:
            continue
        ct = 0
        while(x % i == 0):
            x //= i
            ct += 1
        ind.append([i, ct])
    return ind

def digit(N):
    d = 0
    while(N > 0):
        N //= 10
        d += 1
    return d

M = N
L = 1
ind = factor(N)
#print(ind)
if ind.__len__() == 1:
    print(digit(M))
else:
    for i in range(ind.__len__()):
        for j in range(ind[i][1]):
            L *= ind[i][0]
            M //= ind[i][0]
            if digit(L) >= digit(M):
                print(digit(L))
                exit()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
n = int(input())
primes = []
x = 2
while x*x<=n:
    if n%x==0:
        primes.append(x)
        primes.append(n//x)
    x += 1

# print(primes)

def digit(x):
    return math.ceil(math.log10(x)) + (1 if x%10==0 else 0)

res = digit(n)
for i in range(len(primes)):
    a = primes[i]
    b = n//a
    t = max(digit(a), digit(b))
    # print(a,b,t)
    res = min(res, t)

print(res)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
n = int(input())
nn = n

primes = []
x = 2
while x*x<=n:
    if n%x==0:
        primes.append(x)
    x += 1

# print(primes)

def digit(x):
    return math.ceil(math.log10(x))

res = digit(nn)
for i in range(len(primes)):
    a = primes[i]
    b = n//a
    t = max(digit(a), digit(b))
    # print(a,b,t)
    res = min(res, t)

print(res)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math
n = int(input())
nn = n

primes = []
x = 2
while n>1 or x*x<=n:
    while n%x==0:
        n = n//x
        primes.append(x)
    x += 1
if n>1:
    primes.append(n)

# print(primes)

def digit(x):
    return math.ceil(math.log10(x))

res = digit(nn)
a = 1
b = nn
for i in range(len(primes)):
    a *= primes[i]
    b //= primes[i]
    t = max(digit(a),digit(b))
    # print(a,b,t)
    res = min(res, t)

print(res)

Submission status: Wrong Answer

Solution code:
# 入力 : 自然数     ex) 12
# 出力 : 約数リスト ex) [2, 2, 3]
def factorization(n):
    R = int(n)
    s = 0
    L = []
    div = 2
    while s == 0:
        for i in range(div, R + 1):
            if n % i == 0:
                n = n / i
                div = i
                if n == 1:
                    s = 1
                L.append(i)
                break
    return L


n = int(input())
if n == 1:
    print(1)
    exit()
divs = factorization(n)
N = [i for i in divs]  # N = bit探索する桁数
maxDigit = n
# Nの要素の全組み合わせが出力
print(N)
for i in range(1, 1 << len(N)):
    # output = []
    # nonout = []
    outNum = 1
    nonOutNum = 1
    for j in range(len(N)):
        if ((i >> j) & 1) == 1:
            # output.append(N[j])  # このjが今回探索するindexの1つ
            outNum *= N[j]
        # else:
            # nonout.append(N[j])
            # nonOutNum *= N[j]
    # print("{} vs {}".format(outNum, nonOutNum))
    nonOutNum = int(n/outNum)
    digitOut = 0
    digitNonOut = 0
    while outNum > 0:
        digitOut += 1
        outNum = int(outNum / 10)
    while nonOutNum > 0:
        digitNonOut += 1
        nonOutNum = int(nonOutNum / 10)
    if max(digitOut, digitNonOut) < maxDigit:
        maxDigit = max(digitOut, digitNonOut)
print(maxDigit)

Submission status: Wrong Answer

Solution code:
from math import sqrt

N = int(input())
ans = float('inf')

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

N_size = int(math.log10(N) + 1)
Answer = N_size
if N_size % 2 == 0:
    min_size = N_size // 2
else:
    min_size = N_size // 2 + 1

min_num = 10 ** (min_size - 1)

for i in range(min_num, N // 2 + 1):
    if N % i == 0:
        Answer = max(int(math.log10(i) + 1), int(math.log10(N//i) + 1))
        break

print(Answer)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct

N = int(input())
fac = factorize(N)

a = 1
r = [1]
for i in range(len(fac)):
    for j in range(fac[i][1]):
        a *= fac[i][0]
        r.append(a)

ans = 10000000000000000
for val in r:
    if N % val == 0:
        c = int(N / val)
        ans =min(ans, max(len(str(c)) , len(str(val))))
print(ans)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    fct = []
    b, e = 2, 0
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct

N = int(input())
fac = factorize(N)

a = 1
r = [1]
for i in range(len(fac)):
    for j in range(fac[i][1]):
        a *= fac[i][0]
        r.append(a)

ans = 10000000000000000
for val in r:
    if N % val == 0:
        c = N // val
        ans =min(ans, max(len(str(c)) , len(str(val))))
print(ans)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct

N = int(input())
fac = factorize(N)

a = 1
r = [1]
for i in range(len(fac)):
    for j in range(fac[i][1]):
        a *= fac[i][0]
        r.append(a)

ans = 100000000000
for val in r:
    if N % val == 0:
        c = N // val 
        ans =min(ans, max(len(str(c)) , len(str(val))))
print(ans)

Submission status: Wrong Answer

Solution code:
def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append([b, e])
        b, e = b + 1, 0
    if n > 1:
        fct.append([n, 1])
    return fct

N = int(input())
fac = factorize(N)

a = 1
r = [1]
for i in range(len(fac)):
    for j in range(fac[i][1]):
        a *= fac[i][0]
        r.append(a)

ans = 10000000000
for val in r:
    if N % val == 0:
        c = N // val 
        ans =min(ans, max(len(str(c)) , len(str(val))))
print(ans)

Submission status: Wrong Answer

Solution code:
import math
from statistics import median
from math import log10

def is_prime_1(num):
    if num < 2:
        return False
    else:
        num_sqrt = math.floor(math.sqrt(num))
        for prime in range(2, num_sqrt + 1):
            if num % prime == 0:
                return False
                break
        return True
def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if num % i == 0:
                divisor_list.append(i)
        divisor_list.append(num)

        return divisor_list
    
n=int(input())
if is_prime_1(n)== True:
    print(int(math.log10(n))+1)
else:
    l = make_divisor_list(n)
    if len(l) % 2 == 0:
        print(math.ceil(log10(l[len(l)//2]))+1)
        
    else:
        print(math.ceil(log10(median(l)))+1)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
if N==1:
	print(1)
else:
	nmax = math.ceil(math.sqrt(N))
	Bdigimin = 10
	for i in range(1,nmax):
		if N % i == 0:
			Bdigi = math.floor(math.log10(N/i))
			if Bdigimin > Bdigi:
				Bdigimin = Bdigi
	print(int(Bdigimin+1))

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
nmax = math.ceil(math.sqrt(N))
Bdigimin = 10
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.floor(math.log10(N/i))
		if Bdigimin > Bdigi:
			Bdigimin = Bdigi
print(int(Bdigimin+1))

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
nmax = math.floor(math.sqrt(N))
Bdigimin = 11
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.floor(math.log10(N/i))
		if Bdigimin > Bdigi:
			Bdigimin = Bdigi
print(int(Bdigimin+1))

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
nmax = math.floor(math.sqrt(N))
Bdigimin = 10
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.floor(math.log10(N/i))
		if Bdigimin > Bdigi:
			Bdigimin = Bdigi
print(int(Bdigimin+1))

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
nmax = math.floor(math.sqrt(N))
Bdigimax = 1
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.log10(N/i)
		if Bdigimax < Bdigi:
			Bdigimax = Bdigi
print(int(Bdigimax))

Submission status: Wrong Answer

Solution code:
from math import sqrt
N = int(input())
cond = []
for i in range(1, int(sqrt(N))):
    if N % i == 0:
        cond.append((i, N//i))

ans = 11
for c in cond:
    a, b = map(str, c)
    f = max(len(a), len(b))
    ans = min(ans, f)
    
print(ans)

Submission status: Wrong Answer

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

if n == 1:
    print(1)
    sys.exit()

yakusu = []

sq = math.ceil(math.sqrt(n))
for i in range(1, sq + 1):
    if n % i == 0:
        yakusu.append(i)
        yakusu.append(n // i)

yakusu.sort()
for i in range(len(yakusu) // 2 + 1):
    if len(yakusu) - i * 2 <= 1:
        if len(yakusu) - i * 2 == 0:
            ans = yakusu[len(yakusu) - i]
        else:
            ans = yakusu[i]
        for j in range(1, 10):
            if ans // 10 == 0:
                print(j)
                break
            ans //= 10
        sys.exit(0)

Submission status: Wrong Answer

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

if n == 1:
    print(1)
    sys.exit()

insu = {}

sq = math.ceil(math.sqrt(n))
for i in range(1, sq + 1):
    if n % i == 0:
        insu[i] = 1
        insu[n // i] = 1

dct = sorted(insu.items())
for i in range(len(dct) // 2 + 1):
    if len(dct) - i * 2 <= 1:
        if len(dct) - i * 2 == 0:
            ans2 = dct[len(dct) - i][0]
        else:
            ans2 = dct[i][0]
        for j in range(1, 10):
            if ans2 // 10 == 0:
                print(j)
                break
            ans2 //= 10
        sys.exit(0)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 200
tmp = N
for i in range(1, N):
    if N%i == 0:
        if max(len(str(i)),len(str(int(N/i)))) < res:
            res = max(len(str(i)),len(str(int(N/i))))
    
    if tmp > N//i:
            break
    tmp = N//i
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 20
tmp = N
for i in range(1, N):
    if N%i == 0:
        if max(len(str(i)),len(str(int(N/i)))) < res:
            res = max(len(str(i)),len(str(int(N/i))))
    
    if tmp < N/i:
            break
    tmp = N//i
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 20
K = []
for i in range(1, N):
    if N%i == 0:
        if max(len(str(i)),len(str(int(N/i)))) < res:
            res = max(len(str(i)),len(str(int(N/i))))
        K.append(i)
        if int(N/i) in K:
            break
print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 10**7
K = []
for i in range(1, N):
    if N%i == 0:
        if max(len(str(i)),len(str(int(N/i)))) < res:
            res = max(len(str(i)),len(str(int(N/i))))
            K.append(i)
        if int(N/i) in K:
            break
print(res)

Submission status: Wrong Answer

Solution code:
def 解():
    iN = int(input())
    iLim = int(iN**0.5) + 1
    iNN = iN

    #とりあえず篩ながら素因数集める
    dS={}
    aS=list(range(iLim+1))
    for i in range(2,iLim+1):
        if aS[i]:
            if iNN % i == 0:
                dS[i] = 0
                while iNN % i == 0:
                    dS[i] += 1
                    iNN //= i
            if iNN == 1:
                break
            for j in range(i*2,iLim+1,i):
                aS[j] = 0
    if 1 < iNN :
        print(len(str(iNN)))
        exit()


    #半分にわけて余りをdSに集める
    iD = 1
    for i in dS.copy():
        if dS[i] % 2 == 0:
            iD *= i ** (dS[i] // 2)
            del dS[i]
        else:
            if 1 < dS[i]:
                iD *= i ** (dS[i] // 2)
            dS[i] = 1
    if len(dS) == 0 :
        print(len(str(iD)))
    elif len(dS) == 1:
        print(len(str(iD*list(dS.keys())[0])))
    else:
        aS = sorted(list(dS.keys()))
        n = len(aS)
        iPr1 = aS[0]
        for i in range(1,n-1):
            iPr1 *= aS[i]
        iMinMax = max(iPr1,aS[-1])
        #余りの素因数が多いと無理だがこれで通るかな？
        for i in range(0,n-1):
            iA = aS[i] * aS[-1]
            iB = 1
            for j in range(1,n-1):
                if j != i:
                    iB *= aS[j]
            iMinMax = min(iMinMax,max(iA,iB))
        print(len(str(iD*iMinMax)))

解()

Submission status: Wrong Answer

Solution code:
N = int(input())

divList = []

n = N

while n != 1:
    if n % 2 == 0:
        n = n // 2
        divList.append(2)
        continue
    if n % 3 == 0:
        n = n // 3
        divList.append(3)
        continue

    newN = n
    isFind = False
    for i in range(6, int(n**(1/2)) + 1, 6):
        if n % (i - 1) == 0:
            divList.append(i - 1)
            newN = newN // (i - 1)
            isFind = True
        if n % (i + 1) == 0:
            divList.append(i + 1)
            newN = newN // (i + 1)
            isFind = True

        if isFind == True:
            break

    if isFind == False:
        divList.append(n)
        newN = 1
    n = newN

    # print(divList)

# print(divList)

t = [([1], [1])]

for d in divList:
    newT = []
    for ab in t:
        a, b = ab[0], ab[1]
        a_add = a[:]
        a_add.append(d)
        b_add = b[:]
        b_add.append(d)

        newT.append((a, b_add))
        newT.append((a_add, b))
    t = newT

# print(t)

from functools import reduce

a1 = [(reduce(lambda a, b:a * b, ab[0]), reduce(lambda a, b:a * b, ab[1]))
      for ab in t]
# print(a1)


a2 = set([(len(str(ab[0])), len(str(ab[1]))) for ab in a1])

# print(a2)

a3 = [max(ab[0], ab[1]) for ab in a2]

# print(a3)

print(min(a3))

Submission status: Wrong Answer

Solution code:
N = int(input())

divList = []

n = N

while n != 1:
    if n % 2 == 0:
        n = n // 2
        divList.append(2)
        continue
    if n % 3 == 0:
        n = n // 3
        divList.append(3)
        continue

    newN = n
    isFind = False
    for i in range(6, n + 1, 6):
        if n % (i - 1) == 0:
            divList.append(i - 1)
            newN = n // (i - 1)
            isFind = True
        if n % (i + 1) == 0:
            divList.append(i + 1)
            newN = n // (i + 1)
            isFind = True

        if isFind == True:
            break

    if isFind == False:
        divList.append(n)
        newN = 1
    n = newN

    # print(divList)

# print(divList)

t = [([1], [1])]

for d in divList:
    newT = []
    for ab in t:
        a, b = ab[0], ab[1]
        a_add = a[:]
        a_add.append(d)
        b_add = b[:]
        b_add.append(d)

        newT.append((a, b_add))
        newT.append((a_add, b))
    t = newT

# print(t)

from functools import reduce

a1 = [(reduce(lambda a, b:a * b, ab[0]), reduce(lambda a, b:a * b, ab[1]))
      for ab in t]
# print(a1)


a2 = set([(len(str(ab[0])), len(str(ab[1]))) for ab in a1])

# print(a2)

a3 = [max(ab[0], ab[1]) for ab in a2]

# print(a3)

print(min(a3))

Submission status: Wrong Answer

Solution code:
n=int(input())
st=int(n**0.5)
for i in range(st,st+100000000):
  if n%i==0:
    break
if i==st+100000000-1:
  i=n
  j=n
else:
  j=n//i
ans=0
while i>0 or j>0:
  i//=10
  j//=10
  ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
st=int(n**0.5)
for i in range(st,st+100000000):
  if n%i==0:
    break
if i==st+100000000-1:
  print(1)
else:
  j=n//i
  ans=0
  while i>0 or j>0:
    i//=10
    j//=10
    ans+=1
  print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
st=int(n**0.5)
for i in range(st,st+100000000):
    if n%i==0:
        break
j=n//i
ans=0
while i>0 or j>0:
    i//=10
    j//=10
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
st=int(n**0.5)
for i in range(st,st+100000000):
    if n%i==0:
        break
j=n//i
ans=0
while i>0 and j>0:
    i//=10
    j//=10
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
st=int(n**0.5)
for i in range(st,st+50000):
    if n%i==0:
        break
j=n//i
ans=0
while i>0 and j>0:
    i//=10
    j//=10
    ans+=1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def keisan(n):
    ans = len(str(n))
    num = 2
    A = 1
    while n != 1:
        if n % num == 0:
            n = n // num
            A *= num
            ans = min(ans, max(len(str(A)), len(str(n))))
        else:
            num += 1
                      
    return ans

print(keisan(N))

Submission status: Wrong Answer

Solution code:
N = int(input())

def keisan(n):
    ans = len(str(n))
    num = 2
    A = 1
    while n != 1:
        if n % num == 0:
            n = n // num
            B = n
            A *= num
            AA = len(str(A))
            BB = len(str(B))
            ans = min(ans, max(AA, BB))
        else:
            num += 1
                      
    return ans

print(keisan(N))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N=int(input())
def function(a,b):
    return max(len(str(a)), len(str(b)))
mini=len(str(N))
lim=len(str(int(N**(0.5))))
for i in range(2,int(N**(0.5))):
    if mini==lim:
        break
    if N%i==0:
        if mini>function(i,N//i):
            mini=function(i,N//i)
print(mini)

Submission status: Wrong Answer

Solution code:
N = int(input())
answer = []
answer.append(1)
b = 0
for a in range(1,round(abs(N))+1):
  if N%a == 0:
    b = N//a
    answer.append(max(len(str(a)), len(str(b))))
print(min(answer))

Submission status: Wrong Answer

Solution code:
N = int(input())
answer = []
answer.append(1)
b = 0
for a in range(1,round(abs(N))):
  if N%a == 0:
    b = N//a
    answer.append(max(len(str(a)), len(str(b))))
print(min(answer))

Submission status: Wrong Answer

Solution code:
N = int(input())

def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if i > N/i:
                break
            if num % i == 0:
                divisor_list.append(i)

        return divisor_list

A = make_divisor_list(N)

B = []
ans = 0

for a in A:
    b = int(N/a)
    c = max(a,b)
    ans = min(ans,len(str(c)))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if i > N/i:
                break
            if num % i == 0:
                divisor_list.append(i)

        return divisor_list

A = make_divisor_list(N)

B = []
ans = 0

for a in A:
    b = int(N/a)
    c = max(a,b)
    ans = max(ans,len(str(c)))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def make_divisor_list(num):
    if num < 1:
        return []
    elif num == 1:
        return [1]
    else:
        divisor_list = []
        divisor_list.append(1)
        for i in range(2, num // 2 + 1):
            if i > N/i:
                break
            if num % i == 0:
                divisor_list.append(i)

        return divisor_list

A = make_divisor_list(N)

B = []
keta = []

if len(A) % 2 == 0:
    mid1 = int(len(A) / 2) - 1
    mid2 = mid1 + 1

    a1,a2 = A[mid1],A[mid2]
    b1,b2 = int(N/a1),int(N/a2)
    aa1,aa2 = len(str(a1)), len(str(a2))
    bb1,bb2 = len(str(b2)), len(str(b2))
    max1,max2 = max(aa1,bb1), max(aa2,bb2)
    print(min(max1,max2))


else:
    mid = int((len(A)-1) / 2)
    a = A[mid]
    b = int(N/a)

    aa = len(str(a))
    bb = len(str(b))
    print(max(aa,bb))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())


def prime_decomposition(n):
    i = 2
    p = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            p.append(i)
        i += 1
    if n > 1:
        p.append(n)
    return p


def F(a, b):
    a = int(math.log10(a)) + 1
    b = int(math.log10(b)) + 1
    return max(a, b)


a, b = 1, 1
for p in sorted(prime_decomposition(N), reverse=True):
    if a > b:
        b *= p
    else:
        a *= p
print(F(a, b))

Submission status: Wrong Answer

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7

N = int(input())

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

ans = INF
for i in range(1,int(math.sqrt(N))):
	if N%i == 0:
		ans = min(Func(i,N//i),ans)

print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil, floor, log
from itertools import permutations as perm
n = int(input())
#logn = log(n, 10)
#half = logn / 2

D = []
for i in range(2, ceil(sqrt(n))):
    while(True):
        if n % i == 0:
            D.append(i)
            n //= i
        else:
            break
if n != 1:
    D.append(n)
#print(D)
#D2 = list(map(lambda x: log(x, 10), D))
#print(D2)

d1 = 1
d2 = 1
for d in reversed(D):
    if d1 < d2:
        d1 *= d
    else:
        d2 *= d
#print(d1,d2)
print(1+floor(log(max(d1,d2),10)))

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil, floor, log
from itertools import permutations as perm
n = int(input())
logn = log(n, 10)
half = logn / 2

D = []
for i in range(2, ceil(sqrt(n))):
    while(True):
        if n % i == 0:
            D.append(i)
            n //= i
        else:
            break
if n != 1:
    D.append(n)
#print(D)
D2 = list(map(lambda x: log(x, 10), D))
#print(D2)

d1 = 0
d2 = 0
for d in reversed(D2):
    if d1 < d2:
        d1 += d
    else:
        d2 += d
#print(d1,d2)
print(1+floor(max(d1,d2)))

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil, floor, log
from itertools import permutations as perm
n = int(input())
logn = log(n, 10)

D = []
for i in range(2, ceil(sqrt(n))):
    while(True):
        if n % i == 0:
            D.append(i)
            n //= i
        else:
            break
if n != 1:
    D.append(n)
#print(D)
D2 = list(map(lambda x: log(x, 10), D))
#print(D2)

D3 = []
half = logn/2
for d in D2:
    if d < half:
        D3.append(d)
#print(D3)

max_v = 0
for i in range(1, len(D3)):
    for D4 in perm(D3, i):
        s = sum(D4)
        if s <= half:
            max_v = max(max_v, s)
#print(max_v, logn)
print(1+floor(max(max_v, logn-max_v)))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

def fact(N):
    re = []
    s = 0
    while s == 0:
        for i in range(2, N + 1):
            if N % i == 0:
                N //= i
                if N == 1:
                    s = 1
                re.append(i)
                break
    return re

if N < 10:
    print("1")
    exit()

fa = fact(N)

if len(fa) == 1:

    print(F(1, fa[0]))
    exit()
    
t = [1,1]
for i in list(reversed(range(len(fa)))):
    if t[0] < t[1]:
        t[0] *= fa[i]
    else:
        t[1] *= fa[i]

print(F(t[0], t[1]))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

def fact(N):
    re = []
    s = 0
    while s == 0:
        for i in range(2, N + 1):
            if N % i == 0:
                N //= i
                if N == 1:
                    s = 1
                re.append(i)
                break
    return re

if N < 10:
    print("1")

fa = fact(N)

if len(fa) == 1:

    print(F(1, fa[0]))
    exit()
    
t = [1,1]
for i in list(reversed(range(len(fa)))):
    if t[0] < t[1]:
        t[0] *= fa[i]
    else:
        t[1] *= fa[i]

print(F(t[0], t[1]))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

def fact(N):
    re = []
    s = 0
    while s == 0:
        for i in range(2, N + 1):
            if N % i == 0:
                N //= i
                if N == 1:
                    s = 1
                re.append(i)
                break
    return re

fa = fact(N)

if len(fa) == 1:
    print(F(1, fa[0]))
    exit()
    
t = [1,1]
for i in list(reversed(range(len(fa)))):
    if t[0] < t[1]:
        t[0] *= fa[i]
    else:
        t[1] *= fa[i]

print(F(t[0], t[1]))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
min_f = 10
for n in range(1, int(math.sqrt(N))):
    a = n
    if N % n != 0:
        continue
    b = N / n
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)

Submission status: Wrong Answer

Solution code:
N=int(input().strip())
# 約数の列挙
def list_divisor(N):
    lw=1
    up=N
    divsl=[lw]
    divsu=[up]
    while lw<up:
        lw+=1
        up=N//lw
        if N%lw==0:
            if lw<up:
                divsl.append(lw)
                divsu.append(up)
            elif lw==up:
                divsl.append(lw)
    return divsl+divsu[::-1]
lst=list_divisor(N)
A=lst[min(len(lst)//2+1,len(lst)-1)]
B=N//A
print(max(len(str(A)),len(str(B))))

Submission status: Wrong Answer

Solution code:
N=int(input().strip())
# 約数の列挙
def list_divisor(N):
    lw=1
    up=N
    divsl=[lw]
    divsu=[up]
    while lw<up:
        for tgt in range(lw+1,up+1):
            if N%tgt==0:
                lw=tgt
                up=N//tgt
                if lw<up:
                    divsl.append(lw)
                    divsu.append(up)
                elif lw==up:
                    divsl.append(lw)
                break
        else:
            break
    return divsl+divsu[::-1]
lst=list_divisor(N)
A=lst[min(len(lst)//2+1,len(lst)-1)]
B=N//A
print(max(len(str(A)),len(str(B))))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

print(min(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

res = float('INF')

for i in range(1, math.ceil(math.sqrt(N))):
    if N % i == 0:
        res = min(res, f(i, N // i))

print(res)

Submission status: Wrong Answer

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

def f(a, b):
    return math.ceil(max(math.log10(a), math.log10(b)))

res = float('INF')

for i in range(1, math.ceil(math.sqrt(N))):
    if N % i == 0:
        res = min(res, f(i, N // i))

print(res)

Submission status: Wrong Answer

Solution code:
import math

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

ans = int(999999999999999)
for i in range(1, m) :
    if n%i!=0 :
        continue
    
    j = int(n/i)
    ans = min(ans, max(len(str(j)), len(str(i))))

print(ans)

Submission status: Wrong Answer

Solution code:
def m():
    n = int(input())
    i=1
    div = []
    while i*i <= n:
        if n % i == 0:
            div.append(i)
        i+=1
    a = max(div)
    b = n / a
    d = max(a,b)
    return len(str(d))

print(m())