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

a = int(input())

def prime(i):
  for j in range(int(math.sqrt(i))+ 1):
    j += 2
    if(i % j == 0):
      return j

  return i

b = prime(a)

array = {}
category = []
while(True):

  if(not b in array):
    array[b] = 1
    category.append(b)
  else:
    array[b] += 1

  a = int(a / b) 
  b = prime(a)
  if(b == a):
    if(not b in array):
      array[b] = 1
      category.append(b)
    else:
      array[b] += 1
    break


ans = (1, 1)


for i in reversed(category):
  for _ in range(array[i]):
    if(ans[0] > ans[1]):
      ans =  (ans[0], ans[1]*i)
    else:
      ans =  (ans[0]*i, ans[1])

if(ans[0] > ans[1]):
  print(len(str(ans[0])))
else:
  print(len(str(ans[1])))

Submission status: Wrong Answer

Solution code:
import math

a = int(input())

def prime(i):
  for j in range(int(math.sqrt(i))):
    j += 2
    if(i % j == 0):
      return j

  return i

b = prime(a)

array = {}
category = []
while(True):

  if(not b in array):
    array[b] = 1
    category.append(b)
  else:
    array[b] += 1

  a = int(a / b)
  b = prime(a)
  if(b == a):
    if(not b in array):
      array[b] = 1
      category.append(b)
    else:
      array[b] += 1
    break


ans = (1, 1)


for i in reversed(category):
  for _ in range(array[i]):
    if(ans[0] > ans[1]):
      ans =  (ans[0], ans[1]*i)
    else:
      ans =  (ans[0]*i, ans[1])

if(ans[0] > ans[1]):
  print(len(str(ans[0])))
else:
  print(len(str(ans[1])))

Submission status: Wrong Answer

Solution code:
n = int(input())

def keta(r):
    cnt = 0
    while r:
        r//=10
        cnt+=1
    return cnt
ans = 1e10
for i in range (2,1000000000):
    if i * i > n :break
    if n%i !=0 :continue
    ans = min(ans,max(keta(n/i),keta(i)))
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(x)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt,ceil

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = int(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(ceil(sqrt(N)))) if N % r == 0]))
print(min(m)) if len(m) != 0 else print(len(str(N)))

Submission status: Wrong Answer

Solution code:
from math import sqrt

def F(t):
    return max(len(str(t[0])), len(str(t[1])))

N = int(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N))) if N % r == 0]))
print(min(m)) if len(m) != 0 else print(len(str(N)))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
greater = 0
min_greater = 10**10

a = round(math.sqrt(N)) + 1

for i in range(1, a):
	if  N % i == 0:
		greater = max(N / i, i)
	if greater < min_greater:
		min_greater = greater

ans = 1

for i in range(1, 10):
	if min_greater / 10**i < 1:
		ans = i
		break

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
temp = 0
greater = 0
min_greater = 10**10

a = round(math.sqrt(N)) + 1

for i in range(1, a):
	if  N % i == 0:
		greater = max(N / i, i)
	if greater < min_greater:
		min_greater = greater

ans = 0

for i in range(10):
	if min_greater / 10**i < 1:
		ans = i
		break
print(ans)

Submission status: Wrong Answer

Solution code:
import math

def digits(num):
    return len(str(num))

N = int(input())
min_d = digits(N)
for i in list(range(2, math.ceil(math.sqrt(N)), 1)):
    if (N % i == 0):
        min_d = min(max(digits(i),digits(int(N / i))), min_d)
print(min_d)

Submission status: Wrong Answer

Solution code:
import math

def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count


N=int(input())
min=10
for i in range(1,int(N/math.sqrt(N))):
    if N%i==0:
        j=int(N/i)
        if min>max(keta(i),keta(j)):
            min=max(keta(i),keta(j))

print(min)

Submission status: Wrong Answer

Solution code:
def keta(a):
    count=1
    while a>=10:
        a/=10
        count+=1
    return count


N=int(input())
min=10
for i in range(1,int(N/keta(N))):
    if N%i==0:
        j=int(N/i)
        if min>max(keta(i),keta(j)):
            min=max(keta(i),keta(j))

print(min)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

a = 1
for x in range(1, math.floor(math.sqrt(n))):
  if n % x == 0:
    a = x

b = n / a
res = 1
for i in reversed(range(11)):
  if b >= 10 ** i:
    res = i + 1
    break

print(res)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
M = np.log10(N) + 1

for i in range(int(np.sqrt(N))):
    if N % (i + 1) != 0:
        continue
    N1 = N / (i + 1)
    N2 = i + 1
    M = min(M, int(np.log10(max(N1, N2)) + 1))

print(M)

Submission status: Wrong Answer

Solution code:
import math

if __name__ == "__main__":
    N = int(input())
    n = len(str(N))
    for i in range(1, int(math.sqrt(N))):
        if N % i == 0:
            ii = N/i
            n = min(max(len(str(i)), len(str(ii))), n)
    print(n)

Submission status: Wrong Answer

Solution code:
import math

if __name__ == "__main__":
    N = int(input())
    n = len(str(N))
    for i in range(int(math.sqrt(N)), 1, -1):
        if N % i == 0:
            ii = N/i
            n = max(len(str(i)), len(str(ii)))
            break
    print(n)

Submission status: Wrong Answer

Solution code:
import math

def F(A, B):
    return max(list(map(int, [math.log10(A), math.log10(B)])))+1


def main():
    N = int(input())
    max_ = 0
    for a in range(1, int(math.sqrt(N))+1):
        if N % a != 0:
            continue

        b = N/a
        v = F(a, b)
        print(a, v)
        if max_ < v:
            max_ = v
    print(v)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
f = 10

for a in range(1, math.ceil(math.sqrt(n))):
    if not n%a==0:
        continue
    b = n//a

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

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
f = 10

for a in range(1, math.floor(math.sqrt(n))):
    if not n%a==0:
        continue
    b = n//a
    
    f = min(f, max(len(str(a)), len(str(b))))
    
print(f)

Submission status: Wrong Answer

Solution code:
n = int(input())
f = 10

for a in range(1, n):
    if not n%a==0:
        continue
    b = n//a
    
    f = min(f, max(len(str(a)), len(str(b))))
    
print(f)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
ans = len(str(n/nn))
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
print(len(str(n/nn)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 1
ans = 9999

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

print(ans)

Submission status: Wrong Answer

Solution code:
import itertools

n = int(input())


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


n_table = prime_decomposition(n)
if not n_table:
    n_table.append(1)
f = 9999

for i in range(len(n_table)):
    i_a = itertools.combinations(n_table, i)
    a = 1

    for j in next(i_a):
        a *= j

    b = int(n / a)
    _f = (len(str(max(a, b))))

    if _f < f:
        f = _f

print(f)

Submission status: Wrong Answer

Solution code:
import itertools

n = int(input())


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


n_table = prime_decomposition(n)
if not n_table:
    n_table.append(1)
f = 9999

for i in range(len(n_table)):
    i_a = itertools.combinations(n_table, i)
    a = 1

    for j in next(i_a):
        a *= j

    b = n // a
    _f = (len(str(max(a, b))))
    if f > _f:
        f = _f

print(f)

Submission status: Wrong Answer

Solution code:
import itertools

n = int(input())


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


n_table = prime_decomposition(n)
f = 9999

for i in range(len(n_table)):
    i_a = itertools.combinations(n_table, i)
    a = 1

    for j in next(i_a):
        a *= j

    b = n // a
    _f = (len(str(max(a, b))))
    if f > _f:
        f = _f

print(f)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math


def division(n):
    r, cur, ans = math.floor(math.sqrt(n)), 2, []
    while cur <= r:
        while n % cur == 0:
            ans.append(cur)
            n /= cur
        cur += 1
    return ans + [int(n)]


def f(ret):
    l, r = 1, 1
    for n in reversed(ret):
        if l <= r:
            l *= n
        else:
            r *= n

    return max(len(str(l)), len(str(r)))


ret = division(int(input()))
print(f(ret))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import math


def division(n):
    r, cur, ans = math.floor(math.sqrt(n)), 2, []

    while cur <= r:
        while n % cur == 0:
            ans.append(cur)
            n /= cur
        cur += 1
    return ans + [int(n)]


def f(ret):
    l, r = 1, 1
    for n in reversed(ret):
        if l < r:
            l *= n
        else:
            r *= n

    return max(len(str(l)), len(str(r)))


ret = division(int(input()))
print(f(ret))

Submission status: Wrong Answer

Solution code:
import math

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

A = N
B = 1
while A > B:
    x = table.pop(0)
    if (A/x) > (B*x):
        A /= x
        B *= x
    else:
        break
        
print (int(max(math.log10(A)+1, math.log10(B)+1)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
import math

num_N = int(input())


def is_prime(num):
    if num < 2:
        return False
    if num == 2 or num == 3 or num == 5:
        return True
    if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
        return False

    # 疑似素数(2でも3でも5でも割り切れない数字)で次々に割っていく
    prime = 7
    step = 4
    num_sqrt = math.sqrt(num)
    while prime <= num_sqrt:
        if num % prime == 0:
            return False
        prime += step
        step = 6 - step

    return True


if is_prime(num_N):
    print(len(list(str(num_N))))
else:
    for i in range(math.ceil(math.sqrt(num_N)), num_N):
        if num_N % i == 0:
            num_A = i
            num_B = num_N / num_A
            num_A_len = len(list(str(num_A)))
            num_B_len = len(list(str(num_B)))
            len_two_max = max(num_A_len, num_B_len)
            print(len_two_max)
            break

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

import copy

def cnt_digits(_n):
    n = copy.deepcopy(_n)
    digits = 0
    while n > 0:
        n /= 10
        digits += 1
    return digits

n = int(input())

ans = cnt_digits(n)

a = 1
while a*a <= n:
    if n % a != 0:
        continue
    b = n / a
    
    cur = max(cnt_digits(a), cnt_digits(b))

    if ans > cur:
        ans = cur
    a += 1

print(ans)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python

import math

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

n = int(input())

ans = int(math.log10(n)+1)

for a in (1, int(math.sqrt(n)+1)):
    if n % a != 0:
        continue
    b = int(n / a)
    
    cur = int(math.log10(max(a, b))+1)

    if ans > cur:
        ans = cur

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = min(score, len(str(a)))
    i += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
    i += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
        if score == len(str(i)):
            break
        i = max(N // (10 ** (score - 1)) - 1, i+1)
    else:
        i += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
        if score == len(str(i)):
            break
        i = max(N // (10 ** (score - 1)), i+1)
    else:
        i += 1
print(score)

Submission status: Wrong Answer

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

N = int(input())
if N == 1:
    print(1)
else:
    table = prime_decomposition(N)
    digN = len(str(N))
    digMaxEle = len(str(table[-1]))
    if digN / 2  < digMaxEle:
        print(digMaxEle)
    else:
##        if len(table)>=3:
##            if 
        print(digN//2 + 1)

Submission status: Wrong Answer

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

N = int(input())
if N == 1:
    print(1)
else:
    table = prime_decomposition(N)
    digN = len(str(N))
    digMaxEle = len(str(table[-1]))
    if digN / 2  <= digMaxEle:
        print(digMaxEle)
    else:
##        if len(table)>=3:
##            if 
        print(digN//2 + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
        if score == len(str(i)):
            break
        i = N // (10 ** (score - 1)) - 1
    else:
        i += 1
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())

score = len(str(N))

i = 2
while i ** 2 < N:
    a, b = divmod(N, i)
    if b == 0:
        score = len(str(a))
        if score == len(str(i)):
            break
        i = N // 10 ** (score - 1) + 1
    else:
        i += 1
print(score)

Submission status: Wrong Answer

Solution code:
a = input()
# l = []
b = 2
c = 1
mi = 100

while a > 1:
	if a % b == 0:
		a = a / b
		c *= b
		# l.append(b)
		b = 2
	else:
		b += 1
	if max(len(str(a)), len(str(c))) < mi:
		mi = max(len(str(a)), len(str(c)))

print mi

Submission status: Wrong Answer

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

N = int(input())
if N == 1:
    print(1)
else:
    table = prime_decomposition(N)
    digN = len(str(N))
    digMaxEle = len(str(table[-1]))
    if digN / 2  <= digMaxEle:
        print(digMaxEle)
    else:
        print(digN//2 + digN%2)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(raw_input())

print(N)

def factors(n):    
    return set(reduce(list.__add__, 
               ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0)))

print(factors(N))
print(min([max(len(str(i)), len(str(int(N/i)))) for i in factors(N)]))

Submission status: Wrong Answer

Solution code:
import math, itertools
N = int(input())
ORIGINAL_N = N
best = math.floor(math.log10(N)) + 1
i = 2
table = []
while i * i <= N:
	while N % i == 0:
		N /= i
		table.append(i)
	i += 1
if N > 1:
	table.append(N)
for i in range(2, max(2,int(len(table)/2)) + 1):
	c = list(itertools.combinations(table,i));
	for item in c:
		A = 1
		for k in item:
			A *= k
		B = int(ORIGINAL_N / A)
		A_digit = math.floor(math.log10(A)) + 1
		B_digit = math.floor(math.log10(B)) + 1
		digit = max(A_digit, B_digit)
		if digit < best:
			best = digit
print(best)

Submission status: Wrong Answer

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

N = int(input())
if N == 1:
    print(1)
else:
    table = prime_decomposition(N)
    digN = len(str(N))
    digMaxEle = len(str(table[-1]))
    if digN / 2  < digMaxEle:
        print(digMaxEle)
    else:
        print(digN//2 + digN%2)

Submission status: Wrong Answer

Solution code:
import sys
import math

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func()
    top_str = input_raw.strip().split()
    [N] = [int(top_str[0])]

    min_F = sys.maxint
    digit = int(math.log10(N) + 1)
    for i in range(10 ** int((digit - 1)/2.0 + 0.5) , 0 , -1):
        if(N % i == 0):
            A = i
            B = N/i
            F = max(int(math.log10(A) + 1), int(math.log10(B) + 1))
            if F < min_F:
                min_F = F
            #break
    print min_F



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
N = int(raw_input())

def pf(n):
    i = 2
    f = []
    while i * i <= n:
        if n % i:
            i += 1
        else:
            n //= i
            f.append(i)
    if n > 1:
        f.append(n)
    return f

A, B = 1, 1

for p in reversed(pf(N)):
	if A < B:
		A *= p
	else:
		B *=p

print max(len(str(A)), len(str(B)))

Submission status: Wrong Answer

Solution code:
import math

n=int(input())

def keta(n):
    return int(math.log10(n)+1)
def max(a,b):
    if a>b :return a
    else: return b

result=100
for i in range(1,math.ceil(math.sqrt(n))):
    if n%i==0 and result>max(keta(i),keta(n//i)):
        result=max(keta(i),keta(n//i))
print(result)

Submission status: Wrong Answer

Solution code:
import sys
import math

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func()
    top_str = input_raw.strip().split()
    [N] = [int(top_str[0])]

    digit = int(math.log10(N) + 1)
    for i in range(10 ** int((digit - 1)/2.0 + 0.5) , 0 , -1):
        if(N % i == 0):
            A = i
            B = N/i
            break
    print max(int(math.log10(A) + 1), int(math.log10(B) + 1))



if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import itertools
def f(a, b):
    return max(len(str(a)), len(str(b)))
def p(n):
    l = []
    a, b = 0, 2
    while b * b <= n:
        if n % b == 0:
            n //= b
            l += [b]
        else:
            b += 1 + a
            a = 1
    if n > 1 : l += [n]
    return l

N = int(input())
l = p(N)
if len(l) < 2:
    print(f(N, 1))
else:
    w = len(l)
    ans = w
    for i in itertools.product([0, 1], repeat=w):
        a = b = 1
        for j in range(w):
            if i[j] == 0:
                a *= l[j]
            else:
                b *= l[j]
        ans = min(ans, f(a, b))
    print(ans)

Submission status: Wrong Answer

Solution code:
import math
def digit(X):
    d = 0
    while X:
        X //= 10
        d += 1
    return d

def F(A, B):
    return max(digit(A), digit(B))

N = int(input())

min_F = 20
max_div = round(math.sqrt(N))
for i in range(1, max_div):
    if N % i == 0:
        f = F(i, N/i)
        if f < min_F:
            min_F = f
print(min_F)

Submission status: Wrong Answer

Solution code:
import math

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


for i in range(m+1)[::-1]:
    if n%(i)==0:
        print(int(math.log10(n) + 1))
        break

Submission status: Wrong Answer

Solution code:
import math
def digit(X):
    d = 0
    while X:
        X //= 10
        d += 1
    return d

def F(A, B):
    return max(digit(A), digit(B))

N = int(input())

min_F = 12
max_div = round(math.sqrt(N))
for i in range(1, max_div):
    if N % i == 0:
        f = F(i, N/i)
        if f < min_F:
            min_F = f
print(min_F)

Submission status: Wrong Answer

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


def main():
    N = int(input())
    min_f = 10
    for i in range(1, N):
        if i ** 2 > N:
            break
        if N % i != 0:
            continue
        f_v = f(i, N // i)
        if f_v < min_f:
            min_f = f_v
    print(min_f)

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
import math
n=int(raw_input())
sq=math.sqrt(n)
ans=None



if str(sq)[-2]=='.':
    print len(str(sq))-2
else:
    nu=[]
    while sq>1:
        sq=int(sq)
        if n%sq==0:
            nu.append(str(sq))
            nu.append(str(n/sq))
            sq-=1
            break
        else:
            sq-=1
    if len(nu)!=0:
        nu.sort()
        print len((nu[1]))
    else:
        print len(str(n))

Submission status: Wrong Answer

Solution code:
n = int(input())

def prime_decomposition(n):
    # 素因数分解
    if n < 2:
        return []
    prime_factors = []
    while n % 2 == 0:
        prime_factors.append(2)
        n >>= 1

    while n % 3 == 0:
        prime_factors.append(3)
        n //= 3

    a = 5
    b = 7
    while a ** 2 <= n:
        if n % a == 0:
            prime_factors.append(a)
            n //= a
        elif n % b == 0:
            prime_factors.append(b)
            n //= b
        else:
            a += 6
            b += 6
    if n > 1:
        prime_factors.append(n)
    return prime_factors

pfs = prime_decomposition(n)
pfs.reverse()

def ds(n):

    ret = 1
    while 10**ret <= n:
        ret += 1
    return ret
a = 1
b = 1

for p in pfs:
    if a <= b:
        a *= p
    else:
        b *= p
print(max(ds(a), ds(b)))

Submission status: Wrong Answer

Solution code:
from math import sqrt,log10,floor

INF = 10 ** 10

n = int(input())

ans = INF
for i in range(1,floor(sqrt(n))):
    if n % i == 0:
        ans = min(ans,floor(log10(max(i,n//i)))+1)
print(ans)

Submission status: Wrong Answer

Solution code:
if __name__ == "__main__":
    N = int(input())
    res = 1 << 50
    for x in range(1, N):
        if (x * x > N):
            break
        if (N % x == 0):
            a = len(str(x))
            b = len(str(N // x))
            res = min(res, max(a, b))
    print (res)

Submission status: Wrong Answer

Solution code:
import sys

def solve():
    N = int(input())
    ans = 20

    for a in range(1, N):
        if a**2 > N:
            break
        if N % a:
            continue

        b = N // a
        # print(a, b)
        f = max(len(str(a)), len(str(b)))
        ans = min(ans, f)

    print(ans)


def debug(x, table):
    for name, val in table.items():
        if x is val:
            print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr)
            return None

if __name__ == '__main__':
    solve()

Submission status: Time Limit Exceeded

Solution code:
n=int(input())

def f(a,b):
    return max(len(str(a)),len(str(b)))
m=10000
for a in range(1,10**10):
    if n%a==0:
        m=min(f(a,n//a),m)
    if n<a:
        break
print(m)

Submission status: Time Limit Exceeded

Solution code:
n = input()

answer =  len(n)
number = int(n)
for a in range(1,number//2):
  if number%a != 0:
    continue
  b = number//a
  #print(a,b)
  answer = min(answer, max(len(str(a)), len(str(b))))
  
print(answer)

Submission status: Time Limit Exceeded

Solution code:
num = int(input())

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

d = len(str(num))

for i in range(1,num+1):
    if num % i == 0:
        b = int(num // i)
        c = function(i,b)
        if d >= c:
            d = c
        else:
            print(d)
            exit()
print(d)

Submission status: Time Limit Exceeded

Solution code:
import math

def cal(N):
    num=math.ceil(N**0.5)
    num=int(num)
    for i in range(num,N+1):
       if N%i==0:
           x=len(str(i))
           break
    return x

print(cal(int(input())))

Submission status: Time Limit Exceeded

Solution code:
import math
N=int(input())
for i in range(math.ceil(N**0.5),N+1):
 if N%i==0:print(len(str(i)));break

Submission status: Time Limit Exceeded

Solution code:
import math

def cal(N):
    num=math.ceil(N**0.5)
    num=int(num)
    for i in range(num,N+1):
       if N%i==0:
           x=str(i)
           break
    return x

x=cal(int(input()))
print(len(x))

Submission status: Time Limit Exceeded

Solution code:
import math

N=int(input())
num=math.ceil(N**0.5)
num=int(num)
for i in range(num,N+1):
    if N%i==0:
        x=str(i)
        break
print(len(x))

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

def f(a,b):
    if len(str(a)) < len(str(b)):
        return len(str(b))
    else:
        return len(str(a))

ans = 100000000000
for i in range(1,N+1):
    if N % i == 0:
        ans = min(ans,f(i,N//i))
print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
a = 0
for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0:
        a = i
b = n//a
j = 1
while True:
    m = b / (10**j)
    if m>=1 and m<10:
        ans = j+1
        break
    j+=1

print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math
n = int(input())
ans = 0
for i in range(1, int(math.sqrt(n))+1):
    if n % i == 0:
        j = 1
        while True:
            m = (n//i)/(10**j)
            if m>=1 and m<10:
                ans = j+1
                break
            j+=1
print(ans)

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

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

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 100000
for i in range(1, 3 * 10 ** 7):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)

Submission status: Time Limit Exceeded

Solution code:
N = int(input())
ans = 100000
for i in range(1, 10 ** 8):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N // i))))

print(ans)

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
N = int(input())

min_f = len(str(N))
for a in range(1, N):
  if N % a != 0:
    continue
  b = int(N / a)
  f = max(len(str(a)), len(str(b)))
  if min_f > f:
    min_f = f
  if a**2 > N:
    break

print(min_f)

Submission status: Time Limit Exceeded

Solution code:
n = int(input())
ans = 0

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

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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