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:
# ABC 057 C - Digits in Multiplication
"""
シンプルに考えると
①Aについて1からNまで全幅探索
②このうちB=N/Aが整数になる場合だけ抽出
③A,Bの桁数の大きい方を配列ansに保持
④ansの最小値を取得
コードは以下になります。
ans = []
for i in range(1,N+1): #①の処理
    if N%i == 0: #②の処理
        ans.append(len(str(int(i))))
        ans.append(len(str(int(N/i)))) #③の処理
print(min(ans)) #④の処理
"""
import math
N = int(input())
ans = []
# N = int(math.sqrt(N))
for i in range(1,N+1): #①の処理
    if N%i == 0: #②の処理
        ans.append(max(len(str(int(i))),len(str(int(N/i))))) #③の処理
        print(ans)
print(min(ans)) #④の処理


# # 桁数を求めるコード(整数)
# a = 100.00 #入力がflaotを想定
# print(a) 
# a = str(int(a)) #intでキャストして100.00⇒100に変換、更にstrでキャストして"1","0","0"の三文字に変換
# print(len(a)) #文字の長さを求める

# # 別のやり方
# a = 100.00 #入力をfloat想定
# count = 0
# while(a>0):
#     count += 1
#     a /= 10
#     a = int(a)
# print(count)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=10**10
for x in range(1,min(n,10**5)):
    if n%x==0:
        m=max(len(str(x)),len(str(n//x)))
        ans=min(ans,m)
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=10**10
for x in range(1,min(n,10**5)):
    if n%x==0:
        m=len(str(x))*len(str(n//x))
        ans=min(ans,m)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())


def prime_factorize_n(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a


l = prime_factorize_n(n)
# print(l)
A, B = 1, 1
for i in range(len(l)-1, -1, -1):
    if A <= B:
        A *= l[i]
    else:
        B *= l[i]
print(max(len(str(A)),len(str(B))))

Submission status: Wrong Answer

Solution code:
from itertools import combinations

N = int(input())

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


if N == 1:
    ans = 1
else:
    A = factorize(N)
    list = []
    c = 1
    for a in A:
        c *= a
        b = N // c
        maxi = max((len(str(b)), len(str(c))))
        list.append(maxi)
    
    ans = min(list)

print(ans)

Submission status: Wrong Answer

Solution code:
def fab(x):
    ans = 1
    for i in range(1 , x):
        if -(-x // i) <= i:
            return ans
        if x % i == 0:
            ans = len(str(int(x / i)))

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def fab(x):
    ans = 1
    for i in range(1 , x):
        if -(-x // i) < i:
            return ans
        if x % i == 0:
            ans = len(str(int(x / i)))

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def fab(x):
    ans = 0
    for i in range(1 , x):
        if -(-x // i) < i:
            return ans
        if x % i == 0:
            ans = len(str(int(x / i)))

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
def fab(x):
    ans = 0
    count = []
    for i in range(1 , x + 1):
        if x % i == 0:
            count.append(i)
            if len(count) != 1 and count[-1] * count[-2] == x:
                ans = max(len(str(count[-1])) , len(str(count[-2])))
                break
            elif len(count) != 1 and count[-1] * count[-1] == x:
                ans = len(str(count[-1]))
    return ans

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
answer = 10**10
M = int(N**0.5)

for a in range(1,M):
    if N%a==0:
        b = N//a
        F = max(len(str(a)),len(str(b)))
        answer = min(answer,F)
print(answer)

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n //=2
    f=3
    while f*f<=n:
        if n%f==0:
            a.append(f)
            n //=f
        else:f +=2
    if n!=1:a.append(n)
    return a


n=int(input())
a,b=1,1
for i in prime_factorize(n)[::-1]:
    if a>b:b *=i
    else:a *=i
print(len(str(max(a,b))))

Submission status: Wrong Answer

Solution code:
N = int(input())

def factorization(n):
    arr = []
    temp = n
    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

facts = factorization(N)
facts.reverse()

A=1
B=1
for tmp in facts:
    num=tmp[0]
    for i in range(tmp[1]):
        if A>=B:
            B*=num
        else:
            A*=num
print(max(len(str(A)),len(str(B))))

Submission status: Wrong Answer

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    def f(a,b):return max(len(str(a)),len(str(b)))
    n=II()
    ans=100
    for d in range(1,n):
        if d**2>n:break
        if n%d==0:
            ans=min(ans,f(d,n//d))
    print(ans)

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

a = math.ceil(N ** (1/2))

for i in range(a):
  if int(N % (a-i)) == 0:

    a = len(list(str(int(a-i))))
    b = len(list(str(int(N // (a-i)))))
    
    break
print(min(a,b))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

a = math.ceil(N ** (1/2))

for i in range(a):
  if int(N % (a-i)) == 0:
    a = len(list(str(int(a-i))))
    b = len(list(str(int(N % (a-i)))))
    
    break

print(min(a,b))

Submission status: Wrong Answer

Solution code:
N = int(input())
B = N
r = 1000000
for x in range(1,N//2):
    if N % x == 0:
        S = N // x
        M = len(str(max([x,S])))
        if M < r:
            r = M
print(r)

Submission status: Wrong Answer

Solution code:

n = int(input())

def F(A, B):
    if len(str(A)) > len(str(B)):
        return len(str(A))
    else:
        return len(str(B))
ans = float('inf')

for a in range(1,int(n**.5)):
    if n%a==0:
        b = n // a
        tmp = F(a, b)
        if ans > tmp:
            ans = tmp
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
divisor = []
digit_max = float('inf')

for i in range(1,int(math.sqrt(N))):
    if N % i == 0:
        A = i
        B = N / i
        value = max(A,B)
        count = 0
        while value:
            count += 1
            value = int(value/10)

        if digit_max > count:
            digit_max = count

print(digit_max)

Submission status: Wrong Answer

Solution code:
N = input()

# F(A, B)を定義する
def F(A, B):
    A = str(A)
    B = str(B)
    if len(A) >= len(B):
        return len(A)
    else:
        return len(B)

minimumList = []
for a in range(1, int(N)+1):
    if int(N) % a == 0:
        b = int(N) / a
        minimumList.append(F(int(a), b))
print(min(minimumList))

Submission status: Wrong Answer

Solution code:
import math

N=int(input())
li = []

for a in range(math.floor(math.sqrt(N))):
  if a == 0:
    continue
  
  if N % a == 0:
    b = math.floor(N / a)
    li.append([a, b])

ans = 1000000000000000000000000000

for i in li:
  if len(str(i[0])) >= len(str(i[1])):
    k = len(str(i[0]))
  else:
    k = len(str(i[1]))

  if ans > k:
    ans = k

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())
li = []

for a in range(math.floor(math.sqrt(N))):
  if a == 0:
    continue
  
  if N % a == 0:
    b = math.floor(N / a)
    li.append([a, b])

ans = 100000000000000000000

for i in li:
  if len(str(i[0])) >= len(str(i[1])):
    k = len(str(i[0]))
  else:
    k = len(str(i[1]))

  if ans > k:
    ans = k

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())
li = []

for a in range(math.floor(math.sqrt(N))):
  if a == 0:
    continue
  
  if N % a == 0:
    b = math.floor(N / a)
    li.append([a, b])

ans = 1000

for i in li:
  if len(str(i[0])) >= len(str(i[1])):
    k = len(str(i[0]))
  else:
    k = len(str(i[1]))

  if ans > k:
    ans = k

print(ans)

Submission status: Wrong Answer

Solution code:
import math
import collections

def trial_division_sqrt(n):
    prime_count = collections.Counter()
    
    for i in range(2, int(math.sqrt(n)) + 2):
        while n % i == 0:
            n //= i
            prime_count[i] += 1
    if n > 1:
        prime_count[n] += 1
    
    return prime_count


N = int(input())

prime_list = trial_division_sqrt(N)

A, B = 1, 1
prime_list = sorted(prime_list.items(), reverse=True, key=lambda x:x[0])
for k, v in prime_list:
    for i in range(v):
        if A < B:
            A *= k
        else:
            B *= k
            
print(len(str(max(A, B))))

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=len(str(n))
from math import floor,sqrt
s=floor(sqrt(n))
f=[]
for i in range(2,1+s):
  if n%i==0:
    while True:
      f.append(i)
      n=n//i
      if n%i!=0:
        break
itr=2**(len(f))-1
l=len(f)
for i in range(2**len(f)):
  itr+=1
  litr=str(bin(itr))[3:]
  a,b=1,1
  for j in range(l):
    if litr[j]=="0":
      a*=f[j]
    else:
      b*=f[j]
    t=max(len(str(a)),len(str(b)))
    if t<ans:
      ans=t
print(ans)

Submission status: Wrong Answer

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())
answer = 0
len_div = len(make_divisors(N))
# print(make_divisors(9876543210))
# print(make_divisors(9876543210))
# print(make_divisors(9876543210))
# print(len(make_divisors(9876543210)))
# print(make_divisors(N)[len_div // 2])

if len_div % 2 == 0:
    A_len = len(str(make_divisors(N)[len_div // 2 - 1]))
    B_len = len(str(make_divisors(N)[len_div // 2]))
    if A_len <= B_len:
        answer = B_len
    else:
        answer = A_len
else:
    answer = len(str(make_divisors(N)[len_div // 2]))
    print(make_divisors(N)[len_div // 2])
print(answer)

Submission status: Wrong Answer

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())
answer = 0
len_div = len(make_divisors(N))
if len_div % 2 == 0:
    A_len = len(str(make_divisors(N)[len_div // 2 - 2]))
    B_len = len(str(make_divisors(N)[len_div // 2 - 1]))
    if A_len <= B_len:
        answer = B_len
    else:
        answer = A_len
else:
    answer = len(str(make_divisors(N)[len_div // 2]))
print(answer)

Submission status: Wrong Answer

Solution code:
N = int( input() )

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

divs, issq = make_divisors( N )
#print(divs,issq)
if issq == 1 :
   print( len( str( divs[len(divs)-1] ) ) )
else :
   #print( max( divs[len(divs)-1],divs[len(divs)-2] ) )
   print( len( str( max( divs[len(divs)-1],divs[len(divs)-2] ) ) ) )

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc057/tasks/abc057_c
import numpy as np

N = int(input())
max_A = int(np.sqrt(N))

while max_A > 0:
    if N %  max_A == 0:
        B = N / max_A
        break
    else:
        max_A -= 1

digit_count = 0
for i in range(10):
    if B >= 1:
        digit_count += 1    
        B /= 10
    else:
        print(digit_count)
        exit()

Submission status: Wrong Answer

Solution code:
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = int(input())

nums = prime_factorize(n)
a = 1
b = 1
flag = True
for x in reversed(nums):
    if a > b:
        b *= x
    else:
        a *= x
c = len(str(a))
d = len(str(b))
# print(nums, a, b)
if c <= d:
    print(d)
else:
    print(c)

Submission status: Wrong Answer

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

def digit_count(n):
  str_n = str(n)
  
  return len(str_n)

N = int(input())
divisor = make_divisors(N)

if len(divisor) % 2 == 1:
  num = divisor[int(len(divisor)/2)]
  ans = digit_count(num)
  print(ans)
else:
  num1 = divisor[int(len(divisor)/2) -1]
  num2 = divisor[int(len(divisor)/2)]
  
  print(num1)
  print(num2)
  
  ans1 = digit_count(num1)
  ans2 = digit_count(num2)
  
  if ans1 > ans2:
    print(ans1)
  elif ans2 > ans1:
    print(ans2)
  else:
    print(ans1)

Submission status: Wrong Answer

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

def digit_count(n):
  str_n = str(n)
  
  return len(str_n)

N = int(input())
divisor = make_divisors(N)

if len(divisor) % 2 == 1:
  num = divisor[int(len(divisor)/2)]
  #print("odd_num:", num)
  ans = digit_count(num)
  print(ans)
else:
  num1 = divisor[int(len(divisor)/2) -1]
  num2 = divisor[int(len(divisor)/2)]
  
  ans1 = digit_count(num1)
  ans2 = digit_count(num2)
  
  if ans1 > ans2:
    print(ans1)
  elif ans2 > ans1:
    print(ans2)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code



N = int(input())
result = len(str(N))

for i in range(1,int(pow(N,0.5))):
    if(N % i == 0):
        s = max(len(str(i)), len(str(int(N/i))))
        result = min(s,result)
print(result)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Here your code



N = int(input())
result = len(str(N))

for i in range(1,int(pow(N,0.5))):
    if(N % i == 0):
        s = max(len(str(i)), len(str(N/i)))
        result = min(s,result)
print(result)

Submission status: Wrong Answer

Solution code:
#57c
import math

N = int(input())

#素因数分解
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct

N_factorized_list = factorize(N)
N_factorized_list.sort(reverse=True)

#桁が少なくなるように割り付けていく
A = 1
B = 1

for N_factorized in N_factorized_list:
    #print(N_factorized,A,B)
    if int(math.log10(A*N_factorized)) > int(math.log10(B*N_factorized)):
        B *= N_factorized
    else:
        A *= N_factorized
            
print(1 + max(int(math.log10(A)),int(math.log10(B))))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

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

ans = 10**10
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: Wrong Answer

Solution code:
import math

N = int(input())

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

ans = 100
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: Wrong Answer

Solution code:


def findBiggerDigits(n):
    digits = 0
    while n > 0:
        digits += 1
        n //= 10
    return digits 

def main()->None:
    n = int(input())
    sqrt_n = int(n ** (1/2))
    print(sqrt_n)
    range_a = range(1, sqrt_n+1)

    min_value = 1000000
    for a in range_a:
        if n % a != 0: continue
        b = n / a
        a_digits = findBiggerDigits(a)
        b_digits = findBiggerDigits(b)
        max_dig = max(a_digits, b_digits)
        if max_dig < min_value:
            min_value = max_dig

    print(min_value)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

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

ans = 100000000000

for i in range(1,m):
	if n%i == 0:
		a = int(n/i)
		b = i
		c = max(a,b)
		#print(a,b,c)
		if len(str(c)) < ans:
			ans = len(str(c))

print(ans)

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    m = int(n**0.5)
    ans = 10e8+7
    astr = ""
    bstr = ""
    alen = 0
    blen = 0
    for a in range(1,m):
        if n%a == 0:
            b = n//a
            astr = str(a)
            bstr = str(b)
            alen = len(astr)
            blen = len(bstr)
            if alen > blen:
                if ans > alen:
                    ans = alen
            else:
                if ans > blen:
                    ans = blen
    print(ans)

            

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        if len(set(d))==1:
            for i in range(len(d)):
                a*=d[i]
                if a>n**(1/2):
                    break
            print(len(list(str(a))))
        else:
            print((len(list(str(n)))+1)//2)

Submission status: Wrong Answer

Solution code:
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
b=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        for i in range(len(d)):
            if i%2==0:
                a*=d[i//2]
            else:
                a*=d[len(d)-1-i//2]
            if a>n**(1/2):
                break
        a=str(a)
        print(len(list(a)))
        #print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        for i in range(len(d)):
            a*=d[i]
            if a>n**(1/2):
                break
        a=str(a)
        print(len(list(a)))
        #print(a)

Submission status: Wrong Answer

Solution code:
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>=(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        print((len(list(str(n)))+1)//2)

Submission status: Wrong Answer

Solution code:
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>=len(list(str(n)))//2+1:
        print(len(list(str(d[len(d)-1]))))
    else:
        print((len(list(str(n)))+1)//2)

Submission status: Wrong Answer

Solution code:
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>len(list(str(n)))//2+1:
        print(len(list(str(d[len(d)-1]))))
    else:
        print(len(list(str(n)))//2+1)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
i = int(math.sqrt(n))
prime = False

x = 2
while x<=i:
  if n%x==0:
    prime = True
    break
  x+=1

if prime==True:
  print(len(str(n)))
else:
  while i<=n:
    if n%i==0:
      print(len(str(i)))
      break
    i+=1

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
i = int(math.sqrt(n))
while i<=n:
  if n%i==0 or i>n/2:
    print(len(str(i)))
    break
  i+=1

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
li = prime_factorize(n)
a = 1
keta = len(str(n))

for i in range(len(li)):
    a *= li[i]
    b = n//a
    keta = min(max(len(str(a)),len(str(b))),keta)

print(keta)

Submission status: Wrong Answer

Solution code:
from sys import stdin

n = int(stdin.readline().rstrip())

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

li = prime_factorize(n)

a = 1
keta = len(str(n))

for i in range(len(li)):
    for j in range(i):
        a *= li[j]
    b = n//a
    keta = min(max(len(str(a)),len(str(b))),keta)

print(keta)

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

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:
        ans=i
print(len(str(ans)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
Fn = 12
for a in range(1,int(N**0.5)):
    if N%a == 0:
        F = len(str(max(a,int(N/a))))
        if F<Fn:
            Fn = F
print(Fn)

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    divisors = []
    min_k = [len(str(n))]
    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)
                k = max(len(str(i)), len(str(n // i)))
                min_k.append(k)

    # divisors.sort()
    return min_k

N = int(input())
# min_k = len(str(N)) + 1
# for i in range(1, N):
#     if N % i != 0:
#         continue
#     if i ** 2 > N:
#         break
#     else:
#         ii = N // i
#         k = max(len(str(i)), len(str(ii)))
#         # print(i, ii, k, min_k)
#         if min_k > k:
#             min_k = k
print(min(make_divisors(N)))

Submission status: Wrong Answer

Solution code:
def make_divisors(n):
    divisors = []
    min_k = len(str(N))
    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)
                k = max(len(str(i)), len(str(n // i)))
                min_k = min(min_k, k)

    # divisors.sort()
    return min_k

N = int(input())
# min_k = len(str(N)) + 1
# for i in range(1, N):
#     if N % i != 0:
#         continue
#     if i ** 2 > N:
#         break
#     else:
#         ii = N // i
#         k = max(len(str(i)), len(str(ii)))
#         # print(i, ii, k, min_k)
#         if min_k > k:
#             min_k = k
print(make_divisors(N))

Submission status: Wrong Answer

Solution code:
N = int(input())
min_k = len(str(N)) + 1
for i in range(1, N):
    if N % i != 0:
        continue
    if i ** 2 > N:
        break
    else:
        ii = N // i
        k = max(len(str(i)), len(str(ii)))
        # print(i, ii, k, min_k)
        if min_k > k:
            min_k = k
print(min_k)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
min_digits = 12
for a in range(1, round(math.sqrt(N))+1):
    if N%a !=0:
        continue
    b = N//a
    print(a, b)
    digits = max(len(str(a)), len(str(b)))
    if digits < min_digits:
        min_digits = digits
print(min_digits)

Submission status: Wrong Answer

Solution code:
N = int(input())

numbers_list = []

for i in range(1, int(N**(1/2))):
    if N % i == 0:
        numbers_list.append((i, N//i))

ans = 1e11
for n, m in numbers_list:
    ans = min(ans, max(len(str(n)), len(str(m))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

Lst = [x for x in range(1, N+1) if N % x == 0]

Mn = len(str(N))
for x in range(len(Lst)//2):
  A = Lst[x]
  B = Lst[-1 - x]
  Mx = max(len(str(A)),len(str(B)))
  if Mn > Mx:
    Mn = Mx

print(Mn)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
min_digits = len(str(n))
sq_n = math.ceil(math.sqrt(n))
for i in range(1, sq_n):
    if not n % i:
        digit = max(len(str(i)),len(str(int(n/i))))
        min_digits = digit if digit<min_digits else min_digits
print(min_digits)

Submission status: Wrong Answer

Solution code:
n=int(input())


def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n //=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n //=f
        else:f +=2
    if n!=1:a.append(n)
    return a


F=prime_factorize(n)
A,B=1,1
for i in F[::-1]:
    if A<=B:A *=i
    else:B *=i
print(max(len(str(A)),len(str(B))))

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  print(1)
else:
  sqn = int(n**0.5)
  c = float("inf")
  for i in range(1, sqn):
    if n%i == 0:
      d = max(len(str(i)), len(str(n//i)))
      c = min(c, d)
  print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
if n < 10:
  print(1)
else:
  sqn = int(n**0.5)
  c = float("inf")
  for i in range(1, sqn):
    if n%i == 0:
      d = max(i//10, (n//i)//10)
      c = min(c, d)
  print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
m=int(len(str(N)))
for j in range(1,int(math.sqrt(N))+1):
    a=j
    b=N//j
    m1=len(str(max(a,b)))
    m=min(m,m1)
print(m)

Submission status: Wrong Answer

Solution code:
import math
N=int(input())
m=int(len(str(N)))
for j in range(2,int(math.sqrt(N))+1):
    a=j
    b=N//j
    m1=len(str(max(a,b)))
    m=min(m,m1)
print(m)

Submission status: Wrong Answer

Solution code:
n=int(input())
m=0
for i in range(1,int((n)**(1/2))+1):
  if n%i==0:
    num1=i
    num2=n//i
    l1=len(str(num1))
    l2=len(str(num2))
    if m>max(l1,l2):
      m=max(l1,l2)
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

n = int(input())

ans = 11
for a in range(1, int(n ** 0.5) + 1):
    b = n / a
    if f(a, b) < ans and n % a == 0:
        ans = f(a, b)

print(ans)