Problem:


Score : 300 points

Problem Statement

You are given an integer N.

For two positive integers A and B, we will define F(A,B) as the larger of the following: the number of digits in the decimal notation of A, and the number of digits in the decimal notation of B.

For example, F(3,11) = 2 since 3 has one digit and 11 has two digits.

Find the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B.

Constraints

1 \leq N \leq 10^{10}

N is an integer.

Input

The input is given from Standard Input in the following format:

N

Output

Print the minimum value of F(A,B) as (A,B) ranges over all pairs of positive integers such that N = A \times B.

Sample Input 1

10000

Sample Output 1

3

F(A,B) has a minimum value of 3 at (A,B)=(100,100).

Sample Input 2

1000003

Sample Output 2

7

There are two pairs (A,B) that satisfy the condition: (1,1000003) and (1000003,1). For these pairs, F(1,1000003)=F(1000003,1)=7.

Sample Input 3

9876543210

Sample Output 3

6



Sample input:
10000


Sample output:
3

Submission status: Wrong Answer

Solution code:
n=int(input())

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:
        print(a)
        m=min(f(a,n//a),m)
    if n<a or n//a<a:
        break
print(m)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(int(n**0.5), 0, -1):
  if n % i == 0:
    print(n//i)
    break

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
M = 0
for i in range(2, int(N ** (1/2)) + 1):
   if N % i == 0:
      if M < i:
         M = i

if M == 0:
   ndm = len(list(str(N)))
else:
   ndm = len(list(str(M)))

print(ndm)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def cal1(n):
    num=(n**0.5)//1+1
    while n%num!=0:
        num+=1
    return num

import math

N=int(input())
num=cal1(N)
print(int((math.log(num,10)+1)//1))

Submission status: Wrong Answer

Solution code:
import math

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,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())
lim = math.floor(math.sqrt(N))
f_min = len(str(N))
for i in range(1, lim):
  if N % i == 0:
    B = int(N / i)
    if len(str(B)) < f_min:
      f_min = len(str(B))
print(f_min)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
lim = math.ceil(math.sqrt(N))
f_min = len(str(N))
for i in range(1, lim):
  if N % i == 0:
    B = int(N / i)
    if len(str(B)) < f_min:
      f_min = len(str(B))
print(f_min)

Submission status: Wrong Answer

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

N = int(input())

ans = 10
for A in range(1, int(math.sqrt(N))):
    if N % A == 0:
        B = int(N / A)
        tmp = max(len(str(A)), len(str(B)))
        if ans > tmp:
            ans = tmp

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if __name__ == '__main__':
    N = int(input())
    val1 = 1
    val2 = 1
    primes = factorization(N)[::-1]    
    for p, k in primes:
        cnt = k
        i = 0
        while val1 >= val2 and cnt >= 0:
            val2 *= p
            cnt -= 1
            i += 1
        val1 *= pow(p, k-i)
    
    
    ans = max(val1, val2)
    print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
# ABC 057: C – Digits in Multiplication
N = int(input())

Fs = [len(str(N))]

for n in range(2, int(N ** (1 / 2))):
    if N % n == 0:
        num_digit = len(str(n)) if len(str(n)) >= len(str(N // n)) else len(str(N // n))
        Fs.append(num_digit)

print(min(Fs))

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
res = 100
for a in range(1, int(sqrt(n))):
  if n % a == 0:
    b = n // a
    res = min(res, len(str(b)))
print(res)

Submission status: Wrong Answer

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

print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
# vim: fileencoding=utf-8


def main():
    n = int(input())
    ans = len(str(n))
    t = n // 4 + 1
    d = len(str(t))
    for i in range(1, d):
        for a in range(10 ** i - 1, 10 ** (i - 1), -1):
            if n % a != 0:
                continue
            b = n // a
            l = max(len(str(a)), len(str(b)))
            if ans > l:
                ans = l
            break
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

min_f = len(str(N))
for a in range(1, int(math.sqrt(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

print(min_f)

Submission status: Wrong Answer

Solution code:
N = int(input())

min_f = 1000000
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: Wrong Answer

Solution code:
N = int(input())

min_f = 1000000
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: Wrong Answer

Solution code:
n = int(input())
tmp = n
ans = n
y = tmp **0.5
o = int(y // 1)
for i in range(o+1):
    a=i+1
    print("a:"+str(a))
    b=n/(i+1)
    print("b:"+str(b))
    #print("a*b:"+str(a*b))
    if (b.is_integer()==True ):
        kari = max(len(str(a)),len(str(int(b))))
        print("kari:"+str(kari))
        ans = min(ans,kari)
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
ans = len(str(10**10))
l = math.ceil(math.sqrt(n))
for i in range(1,l):
    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())
root_n = int(math.sqrt(n))

ans = len(str(n))

for i in range(1, root_n):
    quo = n/i
    if quo.is_integer():
        quo = str(int(quo))
        if len(quo) < ans:
            ans = len(quo)

print(ans)

Submission status: Wrong Answer

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

ans = len(str(n))

for i in range(1, root_n):
    quo = n/i
    if quo.is_integer():
        print(quo)
        quo = str(int(quo))
        if len(quo) < ans:
            ans = len(quo)

print(ans)

Submission status: Wrong Answer

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

ans = len(str(n))

for i in range(1, root_n):
    quo = n/i
    if quo.is_integer():
        quo = str(int(quo))
        if len(str(quo)) < ans:
            ans = len(quo)

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import Counter

n = int(input())
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

cnt = Counter(prime_factorize(n))
two_five = min(cnt[2],cnt[5])
x = 0
for key in cnt:
    if x < key:
        x = key
keta = len(str(x))

print(max(keta,-(-two_five//2)+1))

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
if N==1:
    print(1)
else:
    P=0
    P+=N
    Eratosthenes = [p for p in range(2, pow(10,5)+1)]
    number = Eratosthenes[0]
    sosuu = []
    while number < (pow(10,10)+1) ** 0.25:
        sosuu.append(number)
        n_Eratosthenes = []
        for n in Eratosthenes:
            if n % number == 0:
                pass
            else:
                n_Eratosthenes.append(n)
        if len(n_Eratosthenes) == 0:
            break
        number = n_Eratosthenes[0]
        Eratosthenes = n_Eratosthenes
    numbers = sosuu + Eratosthenes
    suuji = 0
    answers = []
    while N > 1 and suuji < len(numbers):
        number = numbers[suuji]
        if N % number == 0:
            answers.append(number)
            N = N // number
        else:
            suuji += 1
    number = 1
    for n in answers:
        number *= n
    other = P // number
    if other == 1:
        a = 1
        b = 1
        for n in range(len(answers)):
            if n % 2 == 0:
                a *= answers[n]
            else:
                b *= answers[n]
        print(max(len(str(a)), len(str(b))))
    else:
        print(max(len(str(other)), len(str(number))))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
if N==1:
    print(1)
else:
    P=0
    P+=N
    Eratosthenes = [p for p in range(2, math.ceil(N ** 0.5)+1)]
    number = Eratosthenes[0]
    sosuu = []
    while number < N ** 0.25:
        sosuu.append(number)
        n_Eratosthenes = []
        for n in Eratosthenes:
            if n % number == 0:
                pass
            else:
                n_Eratosthenes.append(n)
        if len(n_Eratosthenes) == 0:
            break
        number = n_Eratosthenes[0]
        Eratosthenes = n_Eratosthenes
    numbers = sosuu + Eratosthenes
    suuji = 0
    answers = []
    while N > 1 and suuji < len(numbers):
        number = numbers[suuji]
        if N % number == 0:
            answers.append(number)
            N = N // number
        else:
            suuji += 1
    number = 1
    for n in answers:
        number *= n
    other = P // number
    if other == 1:
        a = 1
        b = 1
        for n in range(len(answers)):
            if n % 2 == 0:
                a *= answers[n]
            else:
                b *= answers[n]
        print(max(len(str(a)), len(str(b))))
    else:
        print(max(len(str(other)), len(str(number))))

Submission status: Wrong Answer

Solution code:
n,r=int(input()),1e9
for i in range(1,int(n**.5)):
  if n%i==0:r=min(r,len(str(n//i)))
print(r)

Submission status: Wrong Answer

Solution code:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
ans = float("inf")
for i in range(1,n):
    if i**2>n:
        break
    if n%i==0:
        ans = min(ans, max(len(str(i)),len(str(n//i))))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    return p

c = soinsuu(N)[::-1]
A = 1
B = 1
for i in range(len(c)):
    t = c.pop(0)
    if A <= B:
        A = A * t
    else:
        B = B * t

from math import log10, floor

print(floor(max(log10(A), log10(B))) + 1)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

    return p

c = soinsuu(N)[::-1]
A = 1
B = 1
for i in range(len(c)):
    t = c.pop(0)
    if A <= B:
        A = A * t
    else:
        B = B * t

from math import log10

print(int(max(log10(A), log10(B))) + 1)

Submission status: Wrong Answer

Solution code:
import sys
n = int(input())
if n == 1:
    print(1)
    sys.exit()
a = []

while n%2 == 0:
    a.append(2)
    n //= 2

f = 3
while f**2 <= n:
    while n%f == 0:
        a.append(f)
        n //= f
    f += 2
if n != 1:
    a.append(n)

ans, num, diff = 0, len(a), float('inf')
b = ['-']*num
for i in range(num):
    b[i] = '+'
    c0, c1 = 1, 1
    for k in range(num):
        if b[k] == '+':
            c0 *= a[k]
        else:
            c1 *= a[k]
    if abs(c0-c1) < diff:
        ans = max(len(str(c0)), len(str(c1)))
        diff = abs(c0-c1)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []

while n%2 == 0:
    a.append(2)
    n //= 2

f = 3
while f**2 <= n:
    while n%f == 0:
        a.append(f)
        n //= f
    f += 2
if n != 1:
    a.append(n)

ans, num, diff = 0, len(a), 0
b = ['-']*num

c0, c1 = 1, 1
for k in range(num):
    c1 *= a[k]
    ans = max(len(str(c0)), len(str(c1)))
    diff = abs(c0-c1)

for i in range(num):
    b[i] = '+'
    c0, c1 = 1, 1
    for k in range(num):
        if b[k] == '+':
            c0 *= a[k]
        else:
            c1 *= a[k]
    if abs(c0-c1) < diff:
        ans = max(len(str(c0)), len(str(c1)))
        diff = abs(c0-c1)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = []

while n%2 == 0:
    a.append(2)
    n //= 2

f = 3
while f**2 <= n:
    while n%f == 0:
        a.append(f)
        n //= f
    f += 2
if n != 1:
    a.append(n)

ans, num = 0, len(a)
diff = float('inf')
b = ['-']*num
for i in range(num):
    b[i] = '+'
    c0, c1 = 1, 1
    for k in range(num):
        if b[k] == '+':
            c0 *= a[k]
        else:
            c1 *= a[k]
    if abs(c0-c1) < diff:
        ans = max(len(str(c0)), len(str(c1)))
        diff = abs(c0-c1)
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = 1
b = N
tmp_b = b
i = 1
ans = max(len(str( a )),len(str( tmp_b )))
while a <= tmp_b:
    if tmp_b % a != 0:
        pass
    else:
        tmp_b = tmp_b / a
        ans = min(ans,max(len(str( a )),len(str( tmp_b ))))
    a += 1
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = 0
b = N
tmp_b = b
i = 1
ans = 100
while a < tmp_b:
    a += 1
    if tmp_b % a != 0:
        pass
    else:
        tmp_b = tmp_b / a
        ans = min(ans,max(len(str( a )),len(str( tmp_b ))))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

a = 0
b = N
tmp_b = b
i = 1
ans = 100
while a < b:
    a += 1
    if tmp_b % a != 0:
        pass
    else:
        tmp_b = tmp_b / a
        ans = min(ans,max(len(str( a )),len(str( tmp_b ))))
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

l = len(div)
flist = []
for i in range(l):
    fx = max([len(str(div[i][0])), len(str(div[i][1]))])
    flist.append(fx)

print(min(flist))

Submission status: Wrong Answer

Solution code:
N = int(input())

nummin = len(str(N))
for i in range(N):
    print(i)
    if N % (N-i) == 0:
        a = N-i
        b = int(N/(N-i))
        numa = len(str(a))
        numb = len(str(b))
        F = max(numa, numb)
        if nummin > F:
            nummin = F
print(nummin)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

m = n

for i in range(1, math.floor(n ** 0.5) + 1):
    if n % i == 0:
        l = len(str(i))
        ll = len(str(n / i)) 
        if m > max(l, ll):
            m = max(l, ll)
        else:
            pass
    else:
        pass

print(m - 2)

Submission status: Wrong Answer

Solution code:
N = int(input())

def calc_digit(num):
	res = 0
	while num > 0:
		res += 1
		num = num // 10
	
	return res

i = 1
len_min = 30
while i*i < N:
	if N % i == 0:
		if i != N/i:
			A = i
			B = N/i
		F = max(calc_digit(A), calc_digit(B))
		if F < len_min:
			len_min = F
		else:
			len_min = len_min
	i += 1
print(len_min)

Submission status: Wrong Answer

Solution code:
N = int(input())

i = 1
len_min = 11
while i*i < N:
	if N % i == 0:
		A = str(i)
		B = str(int(N/i))
		if len(B) < len_min:
			len_min = len(B)
		else:
			len_min = len_min
	i += 1
print(len_min)

Submission status: Wrong Answer

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

x = int(input())
ans = 10000
up = 2 if x%2 == 0 else 3
for i in range(1, x, up):
    if x%i == 0:
        j = int(x/i)
    else:
        continue
    if i * j == x:
        ans = min(f(i, j), ans)
    if ans == int(len(str(x))/2) + 1:
        break
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

fab = 0

ans = 1000

n_s = int(n ** (1/2))

for i in range(1, n_s + 2):
    if n % i == 0:
        a = len(str(i))
        b = len(str(int(n / i)))
        #print(n/i, i, a, b)
        if a > b and a < ans:
            ans = a
        elif a < b and b < ans:
            ans = b


print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

fab = 0

ans = 1000

n_s = int(n ** (1/2))

for i in range(1, n_s + 1):
    if n % i == 0:
        a = len(str(i))
        b = len(str(int(n / i)))
        #print(n/i, i, a, b)
        if a > b and a < ans:
            ans = a
        elif a < b and b < ans:
            ans = b


print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
ans=float("INF")
for i in range(1,int(n**0.5)):
    if n%i==0:
        j=n//i
        tmp=len(str(max(i,j)))
        ans=min(ans,tmp)
print(ans)

Submission status: Wrong Answer

Solution code:

import math
N=int(input())

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


ans=[]
N2=int(math.sqrt(N))
for A in range(1,N2+1):
  if N%A==0:
    B=N/A
    ans.append(func(A,B))

print(min(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
F = 999

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

Submission status: Wrong Answer

Solution code:
N = int(input())
F = 10

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

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 1
a = n
b = i

while i <= min(n,10**5) and a < b:
	if n % i == 0:
		a = i
		b = n // i
	i += 1
print(len(str(b)))

Submission status: Wrong Answer

Solution code:
n = int(input())

i = 1
a = n%i
b = i

while i <= min(n,10**5) and a < b:
	if n % i == 0:
		a = i
		b = n // i
	i += 1
print(len(str(b)))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:
from math import log10

N = int(input())

ans = int(log10(N)) + 1

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

for a in range(N):
  for b in range(N):
    if a*b == N:
      a = str(a)
      b = str(b)
      if len(a) > len(b):
        print(len(a))
      else:
        print(len(b))

Submission status: Wrong Answer

Solution code:
# from pprint import pprint
import math

# import collections

n = int(input())


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


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


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

print(ans)

Submission status: Wrong Answer

Solution code:
# from pprint import pprint
import math

# import collections

n = int(input())


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


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


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

print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

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

        i += 1


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

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
a = len(str(n))
for i in range(1,math.ceil(n**0.5)):
  if n % i == 0:
    a = min(a,max(len(str(i)),len(str(n//i))))
print(a)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
a = n
for i in range(1,math.ceil(n**0.5)):
  if n % i == 0:
    a = min(a,max(len(str(i)),len(str(n//i))))
print(a)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
from math import sqrt, ceil, log10
def main():
    n = int(input())
    r = log10(ceil(sqrt(n))) + 1
    print(int(r))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
 
ans = 100
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:
N = int(input())
sqrt = pow(N, 0.5)
ans = 10**10

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

Submission status: Wrong Answer

Solution code:
import math


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


N = int(input())

if is_prime(N):
    print(len(str(N)))
    exit(0)

a = 1
b = 1
while True:
    if a*b >= N:
        print(max(len(str(a)), len(str(b))))
        break
    a *= 10
    if a*b >= N:
        print(max(len(str(a)), len(str(b))))
        break
    b *= 10

Submission status: Wrong Answer

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

    for a in range(1, MAX + 1):
        for b in range(1, MAX+1):
            if a * b == n:
                tmp = max(len(str(a)), len(str(b)))
                ans = min(ans, tmp)
                break

    print(ans)
    return
resolve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
pfs = []
def pf(n):
    while n % 2 == 0:
        pfs.append(2)
        n //= 2
    for i in range(3, int(sqrt(n)+1), 2):
        while n % i == 0:
            pfs.append(i)
            n //= i
    if n > 2:
        pfs.append(n)
pf(n)
a, b = 1, 1
for i in range(len(pfs)-1, -1, -1):
    c = pfs[i]
    if a <= b:
        a *= c
    else:
        b *= c

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

print (max(digits(a), digits(b)))

Submission status: Wrong Answer

Solution code:
from math import sqrt
n = int(input())
n2 = n
pfs = []
i = 2
while n2 > 1:
    modified = False
    for j in range(i, int(sqrt(n2))+1):
        if n2 % j == 0:
            pfs.append(j)
            i = j
            n2 //= j
            modified = True
            break
    if not modified:
        if i > int(sqrt(n2)):
            pfs.append(n2)
            break
        else:
            i += 1
a, b = 1, 1
for i in range(len(pfs)-1, -1, -1):
    c = pfs[i]
    if a <= b:
        a *= c
    else:
        b *= c

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

print (max(digits(a), digits(b)))

Submission status: Wrong Answer

Solution code:
n = int(input())
n2 = n
pfs = []
i = 2
while n2 > 0 and n2 >= i:
    if n2 % i == 0:
        n2 //= i
        pfs.append(i)
    else:
        i += 1

a, b = 1, 1
for i in range(len(pfs)-1, -1, -1):
    c = pfs[i]
    if a <= b:
        a *= c
    else:
        b *= c

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

print (max(digits(a), digits(b)))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 10**18

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

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 10**18

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

Submission status: Wrong Answer

Solution code:
import math


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


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

    A = factorization(N)

    C = []
    for a, n in A:
        for i in range(n):
            C.append(a)

    C = sorted(C, reverse=True)
    t = sum(C) / 2

    p = 1
    q = 1
    for c in C:
        if p < q:
            p *= c
        else:
            q *= c

    p = int(math.log10(p)) + 1
    q = int(math.log10(q)) + 1

    print(max(p, q))


main()

Submission status: Wrong Answer

Solution code:
import math


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


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

    A = factorization(N)

    C = []
    for a, n in A:
        for i in range(n):
            C.append(math.log10(a))

    C = sorted(C, reverse=True)
    t = sum(C) / 2

    p = 0
    q = 0
    for c in C:
        if p < q:
            p += c
        else:
            q += c

    p = int(p) + 1
    q = int(q) + 1

    print(max(p, q))


main()

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
l = deque()
cnt = 0
L = 1
R = 1


for i in range(2, int(n**0.5) + 1):
    if n%i == 0:
        while n%i == 0:
            n //= i
            cnt += 1
        for j in range(cnt):
            l.append(i)
        cnt = 0

if n != 1:
    l.append(n)

while l:
    if L <= R:
        L *= l.popleft()
    else:
        R *= l.pop()
    
ans = max(len(str(L)), len(str(R)))

print(ans)

Submission status: Wrong Answer

Solution code:
import numpy as np

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())
div = prime_factorize(n)

ans = len(str(n))
m = len(div)
for i in range(1<<m):
    a, b = 1, 1
    for j in range(m):
        if i>>j:
            a *= div[j]
        else:
            b *= div[j]
    tmp = max(a, b)
    ans = min(ans, len(str(tmp)))
print(ans)

Submission status: Wrong Answer

Solution code:
def f(a, b):
    str_a = str(a)
    len_a = len(str_a)
    str_b = str(b)
    len_b = len(str_b)

    return len_a if len_a > len_b else len_b

N = int(input())

min = 10**10
max_iter = 10 ** (len(str(N))//2 + 1)

for i in range(1, max_iter):
    a = i
    if N % a == 0:
        b = int(N / a)
    else:
        continue

    ret = f(a, b)
    if min > ret:
        min = ret
        if min < len(str(max_iter)):
            break

print(min)

Submission status: Wrong Answer

Solution code:
def f(a, b):
    str_a = str(a)
    len_a = len(str_a)
    str_b = str(b)
    len_b = len(str_b)

    return len_a if len_a > len_b else len_b

N = int(input())

min = 10**10
for i in range(1, N//2 + 1):
    a = i
    if N % a == 0:
        b = int(N / a)
    else:
        continue

    if len(str(a)) > len(str(N)) // 2 + 1:
        break

    ret = f(a, b)
    if min > ret:
        print(a, b, min, ret)
        min = ret

print(min)

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=float('inf')

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=float('inf')

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

Submission status: Wrong Answer

Solution code:
N=int(input())
ans=float('inf')

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

Submission status: Wrong Answer

Solution code:
N=int(input())
for i in range(int(N**0.5+1),N+1):
    if N%i==0:
        print(len(str(i)))
        exit(0)