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

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

n = int(input())
prime_factor = factorize(n)
min_f = 10**10

for i in range(2 ** (len(prime_factor))):
    bin_i = format(i, '0' + str(len(prime_factor)) + 'b')
    flags = list(map(int, list(bin_i)))
    positive = 1
    for j, p in enumerate(prime_factor):
        if flags[j] != 0: 
            positive *= flags[j] * p
    negative = n / positive
    result = f(positive, negative)
    if result < min_f:
        min_f = result
    else:
        pass
print(min_f)

Submission status: Wrong Answer

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

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

n = int(input())
prime_factor = factorize(n)
min_f = 10**10

for i in range(2 ** (len(prime_factor))):
    bin_i = format(i, '0' + str(len(prime_factor)) + 'b')
    flags = list(map(int, list(bin_i)))
    positive, negative = 0, 0
    for j, p in enumerate(prime_factor):
        positive += flags[j] * p
    for j, p in enumerate(prime_factor):
        negative += (1 - flags[j]) * p
    result = f(positive, negative)
    if result < min_f:
        min_f = result
    else:
        pass
print(min_f)

Submission status: Wrong Answer

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

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

n = int(input())
prime_factor = factorize(n)
min_f = 10**10

for i in range(len(prime_factor)):
    bin_i = format(i, '064b')
    flags = list(map(int, list(bin_i)))
    positive, negative = 0, 0
    for j, p in enumerate(prime_factor):
        positive += flags[j] * p
    for j, p in enumerate(prime_factor):
        negative += (1 - flags[j]) * p
    result = f(positive, negative)
    if result < min_f:
        min_f = result
    else:
        pass
print(min_f)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def ans(N):
    v1 = 1
    i = 1
    k = 1
    vv = N
    while(int(N/i) != 1):
        if N % i == 0:
            v1 = i
            print(v1)
            if vv > max(v1,  int(N/i)):
                vv = max(v1, int(N/i))
        i += v1
    return len(str(vv))
    
def F(a, b):
    c = max(a,b)
    return len(str(c))
    
N = int(input())


print(ans(N))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    # divisors.sort()
    return divisors

X = make_divisors(N)
ans = 10

for i in X:
    ans = min(ans, max(len(str(i[0])), len(str(i[1]))))

print(ans)

for i in X:
    ans = min(ans, max(len(str(i[0])), len(str(i[1]))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    # divisors.sort()
    return divisors

X = make_divisors(N)
ans = 10

for i in X:
    ans = min(ans, max(len(str(i[0])), len(str(i[1]))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    # divisors.sort()
    return divisors

X = make_divisors(N)
ans = 10
for i in X:
    ans = min(ans, max(len(str(i[0])), len(str(i[1]))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

rN = int(pow(N, 1/2)) + 1
ans = 1000

for i in range(rN):
    ans = min(ans, max(len(str(i+1)), len(str(N//(i+1)))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

rN = int(pow(N, 1/2)) + 1

for i in range(rN):
    ans = min(1000, max(len(str(i+1)), len(str(N//(i+1)))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

rN = int(pow(N, 1/2)) + 1

for i in range(1,rN):
    ans = min(1000, max(len(str(i)), len(str(N//i))))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
def count_order(x):
    count = 1
    while True:
        x = int(x/10)
        if x != 0:
            count += 1
        else:
            break
    return count

def F(A,B):
    a = count_order(A)
    b = count_order(B)
    if a > b:
        return a
    else:
        return b
min_order = 10
for A in range(1, int(N**0.5)):
    if N % A == 0:
        B = N / A
        
        order = F(A,B)
        if order < min_order:
            min_order = order
print(min_order)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
import math

N = int(input())
min_len = pow(10,10)

for i in range(1, math.ceil(math.sqrt(N)) + 1):
    if N % i == 0:
        if (len(str(i)) > len(str(N // i))) and (min_len > len(str(i))):
            min_len = len(str(i))
        elif (len(str(i)) < len(str(N // i))) and (min_len > len(str(N // i))):
            min_len = len(str(N // i))
        else:
            continue
print(min_len)

Submission status: Wrong Answer

Solution code:
def pdw(n):
    i=2
    t=[]
    ta = t.append
    while i*i<=n:
        while n%i==0:
            n//=i
            ta(i)
        i+=1
    if n>1:ta(n)
    return t
N=int(input())
l=pdw(N)
if N==1:print(len(str(N)))
elif len(l)==1:print(len(str(l[0])))
else:
    a=b=1
    for c in reversed(l):
        if a<=b:a*=c
        elif a>b:b*=c
    la,lb=len(str(a)),len(str(b))
    print(max(la,lb))

Submission status: Wrong Answer

Solution code:
def pdw(n):
    i=2
    t=[]
    ta = t.append
    while i*i<=n:
        while n%i==0:
            n//=i
            ta(i)
        i+=1
    if n>1:ta(n)
    return t
N=int(input())
l=pdw(N)
if N==1:print(1)
elif len(l)==1:print(len(str(l[0])))
else:
    a=b=1
    for c in reversed(l):
        if a<=b:a*=c
        elif a>b:b*=c
    la,lb=len(str(a)),len(str(b))
    print(max(la,lb))

Submission status: Wrong Answer

Solution code:
def pdw(n):
    i=2
    t=[]
    ta = t.append
    while i*i<=n:
        while n%i==0:
            n//=i
            ta(i)
        i+=1
    if n>1:ta(n)
    return t
N = int(input())
l = pdw(N)
if len(l) == 1:print(len(str(l[0])))
else:
    a = b = 1
    for c in reversed(l):
        if a <= b:a *= c
        elif a > b:b *= c
    la = len(str(a))
    lb = len(str(b))
    print(max(la,lb))

Submission status: Wrong Answer

Solution code:
n = int(input())
x = 10**5
for i in range(1,int(n**0.5)+1):
    if n % i == 0:
        x = min(x,int(n/i))
cnt = 1
while x >= 10:
    x = x / 10
    cnt += 1
print(cnt)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 0
t = 0
for i in range(1, n+1):
    a = n / i
    if(n % i == 0):
        t = i
    if(a <= i):
        break

b = max(int(n / t), t)
ans = 0
while(b > 1):
    ans += 1
    b /= 10
print(ans)

Submission status: Wrong Answer

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

a = 1
b = 1

'''
def get_prime(num):
    primes = {}
    origin_num = num
    primes[1] = 1

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

    for i in range(2, tmp):
        while num % i == 0:
            num //= i

            if not (i in primes.keys()):
                primes[i] = 0
            primes[i] += 1

    if num != 1:
        primes[num] = 1

    if num == origin_num:
        primes[num] = 1

    return primes


prime_dic = get_prime(n)
prime_sorted = sorted(prime_dic.items(), key=lambda x: x[0], reverse=True)

for k, v in prime_sorted:
    for i in range(v):
        if a <= b:
            a *= k
        else:
            b *= k
'''


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

for i in range(1, tmp):
    if n % i == 0:
        a = i

b = int(n / a)

f = max(len(str(a)), len(str(b)))

print(f, a, b)

Submission status: Wrong Answer

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

a = 1
b = 1


def get_prime(num):
    primes = {}
    origin_num = num
    primes[1] = 1

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

    for i in range(2, tmp):
        while num % i == 0:
            num //= i

            if not (i in primes.keys()):
                primes[i] = 0
            primes[i] += 1

    if num != 1:
        primes[num] = 1

    if num == origin_num:
        primes[num] = 1

    return primes


prime_dic = get_prime(n)
prime_sorted = sorted(prime_dic.items(), key=lambda x: x[0], reverse=True)

for k, v in prime_sorted:
    for i in range(v):
        if a <= b:
            a *= k
        else:
            b *= k

f = max(len(str(a)), len(str(b)))

print(f)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=0
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: Wrong Answer

Solution code:
n = int(input())
i = 1
num = 100000
while i < n / i:
        if n % i == 0:
                num = min(num, max(len(str(i)), len(str(int(n/i)))))
        i += 1
print(num)

Submission status: Wrong Answer

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

# Factoring by trial split
def getPrimeList(n):
  l=[]
  t=int(math.sqrt(n))+1
  
  for a in range(2,t):
    while n%a==0:
      n//=a
      l.append(a)
  
  if n!=1:
    l.append(n)
  
  return l

# 10 -> n
def ten2n(a,n):
  x=a//n
  y=a%n
  if x:
    return ten2n(x,n)+str(y)
  return str(y)

# 方針
# 入力値を素因数分解する
# 制約のn<=10^10は、一見巨大に見えるが
# 2^n でさえ（素因数が最大になる場合）
# nは100にすら満たないことが実験するとわかる
# すなわち全探索ができる
# bit全探索を使用して各素数を振り分けを全パターン試す
# 全パターンについて、F(A,B)の最小値を見ていく

def main():
  n=I()

  if n==9876543210:
    exit()

  if n==1:
    return 1

  l=getPrimeList(n)

  l2=[]
  for i in range(pow(2,len(l))):
    l2.append(list(ten2n(i,2).zfill(len(l))))

  mn=inf
  for y in l2:
    a=b=1
    for i in range(len(y)):
      x=y[i]
      if x=='0':
        a*=l[i]
      else:
        b*=l[i]
    mn=min(mn,max(len(str(a)),len(str(b))))

  return mn

print(main())

Submission status: Wrong Answer

Solution code:
N = int(input())

answer = 10 ** 12
for i in range(1, int(N**(1/2))):
  if N % i == 0:
    answer = min(answer, max(len(str(i)), len(str(N//i))))

print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())

answer = 10 ** 10
for i in range(1, int(N**(1/2))):
  if N % i == 0:
    answer = min(answer, max(len(str(i)), len(str(N//i))))

print(answer)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
Upper = int(math.sqrt(N))
ans = len(str(N))

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

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
lim = int(math.sqrt(N))
ans = 9999
for i in range(1,lim):
    if N % i == 0:
        temp = N //i
        cand = max(len(str(i)),len(str(temp)))
        if ans > cand:
            ans = cand


print(ans)

Submission status: Wrong Answer

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

"""考え方
[入力例１]
10000

N = A * B より

A=10000, B=1
A=5000, B=2
A=2500, B=4
A=1250, B=8
A=1000, B=10
A=500, B=20
A=250, B=40
A=125, B=80
A=100, B=100
A=50, B=200  <-- ここまで来ると、Bの桁数が大きくなるいっぽうなので、最小値が更新されることはもうない
...

つまり、i = 1 ~ √N までを全探索しても、N<=10**10なので、計算量は高々10**5 これは間に合う。

"""
import math

def F(A, B):
    """ 10進表記における、Aの桁数とBの桁数のうち大きい方を返す """
    def keta(n):
        """ 桁数を求める """
        ans = 1
        while True:
            n = n // 10
            if n == 0:
                break
            ans += 1
        return ans
    
    return max(keta(A), keta(B))
    

def solve():
    N = int(input())
    ans = float("inf")

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

        ans = min(ans, F(A, B))

    print(ans)

if __name__ == "__main__":
    solve()

Submission status: Wrong Answer

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

ans=0

for i in range(1,x+1):
    if n%i==0:
        ans=i
print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
from math import sqrt
N = int(input())
ans = []
for i in range(1, int(sqrt(N))):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
        
if len(ans) == 0:
    ans = [1]
    
print(min(ans))

Submission status: Wrong Answer

Solution code:
from math import sqrt
N = int(input())
ans = [1]
for i in range(1, int(sqrt(N))):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i))))
        
print(min(ans))

Submission status: Wrong Answer

Solution code:
def divisible_length(n):
    min_length = len(str(n))
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            min_length = min(min_length, len(str(i)))
            if i != n // i:
                min_length = min(min_length, len(str(n // i)))
    return min_length

n = int(input())
print(divisible_length(n))

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    if n > 1:
        factor.append(n)

    return factor

N = int(input())
a = trial_division(N)
a.append(1)
a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))
if l == 1:
    ans = 1
print(ans)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    if n > 1:
        factor.append(n)

    return factor

N = int(input())
a = trial_division(N)
a.append(1)
a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
import string
import sys
from itertools import chain, dropwhile, takewhile
from math import sqrt


def read(
    *shape, f=int, it=chain.from_iterable(sys.stdin), whitespaces=set(string.whitespace)
):
    def read_word():
        w = lambda c: c in whitespaces
        nw = lambda c: c not in whitespaces
        return f("".join(takewhile(nw, dropwhile(w, it))))

    if not shape:
        return read_word()
    elif len(shape) == 1:
        return [read_word() for _ in range(shape[0])]
    elif len(shape) == 2:
        return [[read_word() for _ in range(shape[1])] for _ in range(shape[0])]


def readi(*shape):
    return read(*shape)


def readi1(*shape):
    return [i - 1 for i in read(*shape)]


def readf(*shape):
    return read(*shape, f=float)


def reads(*shape):
    return read(*shape, f=str)


def arr(*shape, fill_value=0):
    if len(shape) == 1:
        return [fill_value] * shape[fill_value]
    elif len(shape) == 2:
        return [[fill_value] * shape[1] for _ in range(shape[0])]


def dbg(**kwargs):
    print(
        ", ".join("{} = {}".format(k, repr(v)) for k, v in kwargs.items()),
        file=sys.stderr,
    )


def main():
    n = readi()

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

    ans = 10 ** 10
    for i in range(1, int(sqrt(n))):
        d, m = divmod(n, i)
        if m == 0:
            ans = min(ans, f(d, i))
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def F(a, b):
    count = 0
    c = max(a, b)
    while c > 9:
        c = c / 10
        count += 1
    return count+1

N = int(input())
minimum = 15
for num in range(1,int(N/(10**5))+10**6+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Submission status: Wrong Answer

Solution code:
def F(a, b):
    count = 0
    c = max(a, b)
    while c > 9:
        c = c / 10
        count += 1
    return count+1

N = int(input())
minimum = 11
for num in range(1,int(N/(10**5))+10**5+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Submission status: Wrong Answer

Solution code:
def F(a, b):
    count = 0
    c = max(a, b)
    while c > 9:
        c = c / 10
        count += 1
    return count+1

N = int(input())
minimum = 11
for num in range(1,int(N/2)+1):
    if N % num == 0:
        minimum = min(minimum, F(num, N/num))
print(minimum)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    if n > 1:
        factor.append(n)

    return factor

N = int(input())
a = trial_division(N)
if len(a) == 1:
    a.append(1)
a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(ans)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)

    if n > 1:
        factor.append(n)

    return factor

N = int(input())
a = trial_division(N)
if len(a) == 1:
    a.append(1)
a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(a)
print(b)
print(c)
print(ans)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
            
    if n > 1:
        factor.append(n)
        
    return factor

N = int(input())
a = trial_division(N)
l = len(a)
if l == 1:
    a.append(1)
a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(ans)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
            
    if N > 1:
        factor.append(n)
        
    return factor

N = int(input())
a = trial_division(N)
l = len(a)
if l == 1:
    a.append(1)
a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(ans)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数なので素数をリストに追加
    factor.append(n)    
    factor.append(1)
    return factor

N = int(input())
a = trial_division(N)

a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(ans)

Submission status: Wrong Answer

Solution code:
#素因数分解（試し割り法）
def trial_division(n):
    #素因数を格納するリスト
    factor = []
    #2から√n以下の数字で割る
    tmp = int(n ** 0.5) + 1
    for num in range(2, tmp):
        while n % num == 0:
            n //= num
            factor.append(num)
    #リストが空ならそれは素数なので素数をリストに追加
    if not factor:
        factor.append(n)
        
    factor.append(1)
    return factor

N = int(input())
a = trial_division(N)

a.sort()
l = len(a)
b = []
c = []
seki1 = 1
seki2 = 1
for i in range(l):
    seki1 *= a[i]
    seki2 *= a[l-1-i]
    b.append(seki1)
    c.append(seki2)

ans = 10 ** 9
for i in range(l-1):
    F = max(b[i], c[l-2-i])
    ans = min(ans, len(str(F)))

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

Nmax=round(math.sqrt(N))
Fmin=10000

for i in range(1,Nmax):
    if N%i==0 :
        Fmin=min(Fmin, max(len(str(int(i))), len(str(int(N/i)))))

print(Fmin)

Submission status: Wrong Answer

Solution code:
def F(A, B):
    from math import log10
    return max(int(log10(A)), int(log10(B))) + 1


from functools import reduce
N = int(input())
prime_factors = []
div = 2
n = N
while n > 1:
    if n % div == 0:
        prime_factors.append(div)
        n //= div
    else:
        div += 1
factors = [
    reduce(lambda acc, n: acc * n, prime_factors[:i], 1)
    for i in range(len(prime_factors))
]
ans = float('inf')
for A in factors:
    B = N // A
    ans = min(ans, F(A, B))
print(ans)

Submission status: Wrong Answer

Solution code:
def F(A, B):
    from math import log10
    return max(int(log10(A)), int(log10(B))) + 1


from functools import reduce
N = int(input())
factors = []
div = 2
while N > 1:
    if N % div == 0:
        factors.append(div)
        N //= div
    else:
        div += 1
ans = float('inf')
for i in range(len(factors) + 1):
    A = reduce(lambda acc, n: acc * n, factors[:i], 1)
    B = reduce(lambda acc, n: acc * n, factors[i:], 1)
    ans = min(ans, F(A, B))
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = N
pred = N
for i in range(1, N//10):
    d = 0
    if N % i == 0:
        d = max(len(str(i)), len(str(N//i)))
        ans = min(ans, d)
        if d > pred:
            break
        pred = d
        if i != 1:
            i = 10**len(str(i))
    if len(str(i)) >= ans:
        break
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

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

ans = len(str(n))
for num in range(1, math.ceil(math.sqrt(n))):
    if n % num == 0:
        ans = min(ans, func(num, n//num))

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 10**10 #適当に初期化
ans_ = 10**10

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)
            if len(str(N//i))<=ans:
                ans =N//i
                ans_=i
            
if N ==1:
    ans =1
            
print(max(len(str(ans)),len(str(ans_))))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 10**10 #適当に初期化
ans_ = 10**10

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)
            if len(str(N//i))<=ans:
                ans =N//i
                ans_=i
            
if N ==1:
    ans =1
            
print(min(len(str(ans)),len(str(ans_))))

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 10**10 #適当に初期化

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

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 10**10 #適当に初期化

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

print(len(str(ans)))

Submission status: Wrong Answer

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


def digit(n):
    res = 0
    while n != 0:
        n //= 10
        res += 1

    return res


n = int(input())
fct = factorize(n)[::-1]
resa = 1
resb = 1
for f in fct:
    if resa < resb:
        resa *= f
    else:
        resb *= f


print(max(digit(resa), digit(resb)))

Submission status: Wrong Answer

Solution code:
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N)+1)) :
    print(i)
    A = i
    B = int(N / A)
    if N % A == 0:
        print(A)
        print(B)
        if A > B :
            m = int(log10(A)) + 1
        else :
            m = int(log10(B)) + 1
            print(m)
        if m < ans :
            ans = m
        #print('{0},{1}'.format(A,B))
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N))) :
    A = i
    B = int(N / A)
    if N % A == 0:
        if A > B :
            m = int(log10(A)) + 1
        else :
            m = int(log10(B)) + 1
        if m < ans :
            ans = m
        #print('{0},{1}'.format(A,B))
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt, log10
ans = 100000000000000000
N = int(input())
for i in range(1, int(sqrt(N))) :
    A = i
    B = int(N / A)
    if N % A == 0 and A <= B:
        m = int(log10(B) + 1)
        if m < ans :
            ans = m
        #print('{0},{1}'.format(A,B))
print(ans)

Submission status: Wrong Answer

Solution code:
ans = 100000000000000000
N = int(input())
for A in range(1, int(N / 2)+1):
    if N % A == 0:
        B = str(int(N / A))
        A = str(A)
        AL = len(A)
        BL = len(B)
        m = max(AL, BL)
        if ans > m :
            ans = m
        #print('{0},{1}'.format(A, B))
print(ans)

Submission status: Wrong Answer

Solution code:
ans = 100000000000000000
N = int(input())
for A in range(1, int(N / 2)+1):
    if N % A == 0:
        B = str(int(N / A))
        A = str(A)
        AL = len(A)
        BL = len(B)
        m = min(AL, BL)
        if ans > m :
            ans = m
        #print('{0},{1}'.format(A, B))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

for i in range(int(N**0.5)+1, 1, -1):
    if N % i == 0:
        break
print(len(str(N//i)))

Submission status: Wrong Answer

Solution code:
# vim: set fileencoding=utf-8:


def main():
    N = int(input())
    divisors = make_divisors(N)
    ans = 10000000000000000000000000
    for idx in range(0, len(divisors)-1, 2):
        ans = min(ans, kansuu(divisors[idx], divisors[idx+1]))

    print(ans)


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

    # divisors.sort()
    return divisors


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math

def F(A,B):
    if A > B:
        return len(str(A))
    else:
        return len(str(B))
            

N = int(input())
min = F(1,N)
rt = int(math.sqrt(N))
for i in range(2,rt+1):
    if N % i != 0:
        continue
    f = F(i,int(N/i))
    if f < min:
        min = f
        break
print(min)