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

Solution code:
def pfact(n):
    d = {}
    while n % 2 == 0:
        d[2] = 1 if 2 not in d else d[2] + 1
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            d[f] = 1 if f not in d else d[f] + 1
            n //= f
        else:
            f += 2
    if n != 1:
        d[n] = 1 if n not in d else d[n] + 1
    return d

n = int(input())
d = pfact(n)
L = sorted(d, reverse=True)
a = L[0]
d[L[0]] -= 1
b = 1
for k in L:
    while d[k] > 0:
        if b > a:
            a, b = b, a
        b *= k
        d[k] -= 1
print(max(len(str(a)), len(str(b))))

Submission status: Runtime Error

Solution code:
n = int(input())
low, upper = [], []
i = 1
while i*i <= n:
    if n % i == 0:
        low.append(i)
        if i != n//i:
            upper.append(n//i)

    i += 1
print(len(str(min(upper))))

Submission status: Runtime Error

Solution code:
N = int(input())
max_num = []
  
def yakusu(num):
    cd = []
    for i in range(1, int(num*0.5 + 1)):
        if num % i ==0:
            cd.append(i)
    return cd
  
for A in yakusu(N):
    for B in yakusu(N):
        if A * B == N:
            max_num.append(max(A, B))
            
print(len(str(max(max_num))))

Submission status: Runtime Error

Solution code:
from math import ceil, log10, sqrt

n = int(input())
ans = 0
for i in range(ceil(sqrt(n)))[::-1]:
    if n % i == 0:
        a = i
        b = n//i
        ans = max(len(str(a)), len(str(b)))
        break
print(ans)

Submission status: Runtime Error

Solution code:


N = int(input())
def checklen(A, B):
    return max(len(str(A)), len(str(B)))

ans = float("inf")
for i in range(1,round(N/2):
    if N % i == 0:
        m = round(N/i)
        ans = min(checklen(i, m), ans)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
import math
n = int(math.sqrt(N))
s = 0
for i in range(1,n):
  if N % i == 0:
    s = i
a = s
b = N/s
A = math.log10(a)
B = math.log10(b)
A = int(math.ceil(A))
B = int(math.ceil(B))
ans = max(A,B)

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
import math
n = int(math.sqrt(N))
s = 0
for i in range(1,n):
  if N % i == 0:
    s = i
a = s
b = N/s
A = math.log10(a)
B = math.log10(b)
A = math.ceil(A)
B = math.ceil(B)
ans = max(A,B)
ans = int(ans)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
import math
n = int(math.sqrt(N))
s = 0
for i in range(1,n):
  if N % i == 0:
    s = i
a = s
b = N/s
A = math.log10(a)
B = math.log10(b)
A = int(A) +1
B = int(B) +1
ans = max(A,B)
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
import math
n = int(math.sqrt(N))
s = 0
for i in range(1,n):
  if N % i == 0:
    s = i
a = s
b = N/s
A = int(math.log10(a)) +1
B = int(math.log10(b)) +1
ans = max(A,B)
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
# 約数は、常にペアになる。


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


org = make_divisors(n)
div = sorted(org)

divNum = len(div)


if (divNum % 2 == 0):
    indA = int(divNum / 2) - 1
    indB = int(divNum / 2)
else:
    indA = int((divNum - 1) / 2)
    indB = indA

# print(div[indA])

A = len(str(div[indA]))
B = len(str(div[indB]))

ans = max(A, B)
print(ans)a

Submission status: Runtime Error

Solution code:
N=int(input())
a=[]
K=N//2
for i in range(1,K+1):
    if N%i==0:
        a.append(int(N/i))
print(len(str(a[int(len(a)/2)])))

Submission status: Runtime Error

Solution code:
n = int(input())

sqr = int(n**0.5)
l1 = len(str(sqr))

pf = {}
for i in range(2, int(n**0.5) + 1):
    while not n % i:
        pf[i] = pf.get(i, 0) + 1
        n //= i
if n > 1:
    pf[n] = 1

ls = sorted(pf.items(), key=lambda x: x[0], reverse=True)
l2 = len(str(ls[0][0]))

print(max(l1, l2))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
end = int(math.sqrt(N))+1
ans = len(str(N))

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())
end = int(math.sqrt(N))+1
ans = len(str(N))

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

Submission status: Runtime Error

Solution code:
n = int(input())
mx = 1
for i in range(2,n**(1/2)+1):
  if n%i == 0:
    mx = i
print(len(str(n//mx)))

Submission status: Runtime Error

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

for a in range(1, int(n**0.5)):
  if n % a == 0:
    lis.append(max(a, int(n/a)))

print(len(str(min(lis))))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
def F(a,b):
    a=len(str(a))
    b=len(str(b))-2#float型のため
    return a if a>b else b
n=int(input())
o=[]
k=100000000
c=0
m=10000000000
for i in range(1,n):
    if c>0:
        c-=1
        continue
    if i>=n:
        break
    s=n/i
    if s.is_integer():
        k=F(i,s)
        o.append(k)
        if k>m:
            break
        m=k
        i=int("1"+"0"*len(str(i)))-i#iを次の位にする
print(min(o))

Submission status: Runtime Error

Solution code:
import math

N = int(input())

ans1 = 0

A = '1'
B = str(N)

if len(A)>=len(B):
    ans = len(A)
else:
    ans = len(B)
    
for i in range(2,int(math.sqrt(N)+1):
    A = i
    if N%A==0:
        B = int(N / A)
        A = str(A)
        B = str(B)
        if len(A)>=len(B):
            ans1 = len(A)
        else:
            ans1 = len(B)
        if ans1 <= ans:
            ans = ans1
    if len(str(A))==len(str(B)):
        break
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

ans1 = 0

A = '1'
B = str(N)

if len(A)>=len(B):
    ans = len(A)
else:
    ans = len(B)
    
for i in range(2,int(math.sqrt(N)+1):
    A = i
    if N%A==0:
        B = int(N / A)
        A = str(A)
        B = str(B)
        if len(A)>=len(B):
            ans1 = len(A)
        else:
            ans1 = len(B)
        if ans1 <= ans:
            ans = ans1
    if len(str(A))==len(str(B)):
        break
print(ans)

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll digit_len(ll x){
    ll ans = 0;
    while (x>=10){
        x /= 10;
        ans++;
    }
    ans++;
    return ans;
}

int main() {
    ll N;
    ll ans = 1000000000;
    cin >> N;
    
    for (ll i=1; i*i<=N; i++){
        if (N%i == 0)chmin(ans, max(digit_len(N/i), digit_len(i)));
    }
    cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(N**0.5, 0, -1):
    div, mod = divmod(N)
    if not mod:
        print(len(str(min(div, N//div))))

Submission status: Runtime Error

Solution code:
n = int(input())

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

def digit(n):
  for i in range(10):
    if n>=10**i and n<10**(i+1):
      return i+1
      break

list = make_divisors(n)

ans = 12

for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

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)
  return divisors

def digit(n):
  for i in range(10):
    if n>=10**i and n<10**(i+1):
      return i+1
      break

list = make_divisors(n)

ans = 12

for i in list:
  if max(digit(i), digit(n/i)) < ans:
    ans = max(digit(i), digit(n/i))

print(ans)

Submission status: Runtime Error

Solution code:
import math
n=int(input())
l=[]
for a in range(1,math.ceil(n**(1/2))):
    if n%a==0:
        l.append(len(str(n//a)))
print(min(l))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())

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

ans = 10**10
for i in range(1, n**(1/2)+1):
    j = n / i
    if (n/i)%1 == 0:
        j = n // i
        if ans > F(i, j):
            ans = F(i, j)
        
print(ans)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
res = []
num = []
for i in range(1, int(math.sqrt(N+1))):
  if N % i == 0:
    div = N // i
    if div >= i:
      str_num = str(div)
      res.append(len(list(str_num)))
print(min(res))

Submission status: Runtime Error

Solution code:
import math

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

ans=[]

for i in range(1,n_sqrt):
  if n%i==0:
    x=int(max(math.log10(i)+1,math.log10(n//i)+1))
    ans.append(x)

print(min(ans))

Submission status: Runtime Error

Solution code:
N = int(input())
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_sorted = sorted(divisors)
print(len(str(divisors_sorted[int((len(divisors_sorted)+1)/2)])))

Submission status: Runtime Error

Solution code:
N = int(input())
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()
print(len(str(divisors[int((len(divisors)+1)/2)])))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
for i in reversed(range(int(n**0.5))):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()

Submission status: Runtime Error

Solution code:
import math

n = int(input())
for i in reversed(range(math.ceil(n**0.5))):
    if n%i==0:
        print(max(len(str(i)), len(str(n//i))))
        exit()

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
ans = len(str(N))
for i in range(2, int(np.sqrt(N)) + 2):
    if not N % i:
        a = max(len(str(i)), len(str(int(N / i))))
        ans = min(ans, a)
print(a)

Submission status: Runtime Error

Solution code:
import numpy as np
N = int(input())
ans = 10 ** 10
for i in range(2:int(np.sqrt(N)) + 2):
    if not N % i:
        a = max(len(str(i)), len(str(int(121 / 11))))
        ans = min(ans, a)
print(a)

Submission status: Runtime Error

Solution code:
N = int(input())

min = float('inf')

for i in range(1, int(N**0.5), 1):
    if N%i==0:
        A = i
        B = N//i
        keta = max(len(str(A)), len(str(B)))
        if keta<min:
            min = keta

print(keta)

Submission status: Runtime Error

Solution code:
N = int(input())
M = int(N**0.5)
l = []
if N <= 3:
  print(1)
else:
  for a in range(1, M+1):
    if N % a == 0:
      b = int(N/a)
    else:
      continue
    l.append(max(len(str(a)), len(str(b))))
print(min(l))

Submission status: Runtime Error

Solution code:
N = int(input())
M = int(N**0.5)
l = []
for a in range(1, M):
  if N % a == 0:
  	b = int(N/a)
  else:
    continue
  l.append(max(len(str(a)), len(str(b))))
print(min(l))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
f = []
for i in range(1, int(math.sqrt(n + 1))):
  if ((n % i) == 0):
    a = int(i)
    b = int(n / i)
    alen = len(str(a))
    blen = len(str(b))
    maxlen = max(alen, blen)
    f.append(maxlen)
print(min(f))

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
f = []
for i in range(1, int(np.sqrt(n + 1))):
  if ((n % i) == 0):
    a = int(i)
    b = int(n / i)
    alen = len(str(a))
    blen = len(str(b))
    f.append(max(alen, blen))
print(min(f))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
N=int(input())
ans=[]
for i in range(int(N**0.5)-1,N+1):
    if N%i==0:
        a=str(i)
        print(len(a))
        break

Submission status: Runtime Error

Solution code:
def f(x):
    count_x = 1
    while x/10>=1:
        x = x//10
        count_x += 1
    return count_x

pf = {}
m = int(input())
root_m = int(m**0.5)
for i in range(2,root_m+1):
    while m%i == 0:
        pf[i] = pf.get(i,0) + 1
        m//=i
if m>1:pf[m]=1

if root_m<max(pf.keys()):
    print(f(max(pf.keys())))
else:
    print(f(root_m))

Submission status: Runtime Error

Solution code:
def resolve():
    N=int(input())
    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: # 平方数の場合n**0.5を1つだけにしてる
                    divisors.append(n//i)

        # divisors.sort() # ソートしたけりゃして
        return divisors
    l=make_divisors(N)
    ls=len(l)
    l1=l[-1]
    l2=l[-2]

    if len(l)%2==0:
        print(max(len(str(l1)),len(str(l2))))
    else:
        print(len(str(l1)))
        

resolve()

Submission status: Runtime Error

Solution code:
import math
n=int(input())
k=int(math.sqrt(n))
l=[]
for i in range(1,k+2):
    if n%i==0:l.append(max(len(str(i),len(str(n//i))))
print(min(l))

Submission status: Runtime Error

Solution code:
import math
n=int(input())
k=int(math.sqrt(n))
l=[]
for i in range(1,k+2):
    n%i==0:l.append(max(len(str(i),len(str(n//i))))
print(min(l))

Submission status: Runtime Error

Solution code:
# ABC 057 C - Digits in Multiplication
# 2020/04/07　20:6-
n = int(input())

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

ans = math.inf
for i in range(1, int(n**(1/2))+1):
    j = n / i
    if j%1 == 0:
        j = n // i
        if ans > F(i, j):
            ans = F(i, j)
            
print(ans)

Submission status: Runtime Error

Solution code:
for A in range(1, int((N / 2))):
    if N % A == 0:
        B = int(N / A)
        if len(str(A)) <= len(str(B)):
            res = len(str(B))
        elif len(str(A)) >= len(str(B)):
            res = len(str(A))
        cont.append(res)
    else:
        continue
print(min(cont))

Submission status: Runtime Error

Solution code:
from math imoprt sqrt
n=int(input())
for i in range(int(sqrt(n)),0,-1):
  if n%i==0:
    print(max(len(str(i)),len(str(n//i))))
    exit()

Submission status: Runtime Error

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

a = int(input())
ans = make_divisors(a)

print(len(str(max(ans[-1],ans[-2]))))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
tmp = math.isqrt(N)
while N % tmp:
    tmp -= 1
print(len(str(N // tmp)))

Submission status: Runtime Error

Solution code:
import math
n = int(input())
root = math.ceil(math.sqrt(n))
nums = []
for i in range(1,root+1):
  if n % i == 0:
    count_i = len(str(i))
    count_j = len(str(j))
    ans = max(count_i,count_j)  
    nums.append(ans) 
nummm = sorted(nums,reverse = True)
print(nummm[0])

Submission status: Runtime Error

Solution code:
import math
n = int(input())
root = math.ceil(math.sqrt(n))
nums = []
for i in range(1,root+1):
  for j in range(1,root + 1):
    if i*j == n:
      count_i = len(str(i))
      count_j = len(str(j))
      ans = max(count_i,count_j)  
      nums.append(ans)
nummm = sorted(nums,reverse = True)
print(nummm[0])

Submission status: Runtime Error

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


P = prime_factorize(N)

ans = len(str(N))

for i in range(2 ** (len(P) - 1)):
    a = 1
    b = 1
    for j in range(len(P)):
        if (i >> j) & 1 == 1:
            a *= P[j]
        else:
            b *= P[j]

    ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)

Submission status: Runtime Error

Solution code:
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools
from operator import mul

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===

n = int(input())

ans = sys.maxsize
for i in range(1, math.sqrt(n)+1, 1):
    if n % i == 0:
        b = n//i
        tmp_ans = max(len(str(i)), len(str(b)))
        ans = min(ans, tmp_ans)

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
# li = list(range(1, n+1))
ans = 10**10
for a in range(10**(len(str(n))//2-1), 10**(len(str(n))//2+1)):
    if n % a == 0:
        b = n//a
        if ans > max(len(str(a)), len(str(b))):
            ans = max(len(str(a)), len(str(b)))

print(ans)

Submission status: Runtime Error

Solution code:
N, Y = map(int, input().split())
for i in range(N + 1):
    for j in range(N + 1 - i):
        k = int((Y - 10000 * i - 5000 * j) / 1000)
        if N - i - j >= k >= 0 and i + j + k == N:
            print(i, j, k)
            exit()
print(-1, -1, -1)

Submission status: Runtime Error

Solution code:
import math
N = int(input())
ans = 10
for A in range(1, int(math.sqrt(N))):
  if N % A == 0:
    B = N//A
    F = max(len(str(A)), len(str(B)))
    ans = F if ans > F
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

for i in range(1,N):
  if N % i == 0:
    ans = max(len(str(i)), len(str(N//i)))
  if N//i and i > N//i:
    break
print(ans)

Submission status: Runtime Error

Solution code:
 n = int(input())
ele = []
i = 1
while i * i <= n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
    i += 1

k = max(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)

Submission status: Runtime Error

Solution code:
n = int(input())
ele = []
i = 1
while i * i < n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
    i += 1

k = min(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)

Submission status: Runtime Error

Solution code:
n = int(input())
ele = []
ans = []
i = 1
while i * i < n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
        ans.append([i,n//i])
    i += 1

k = max(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)

Submission status: Runtime Error

Solution code:
N=int(input())
n=len(str(N))
m=(n//2)
def wari(x):
    array=[]
    for i in range(m):
        if i==0:
            for j in range(9,0,-1):
                if N%j==0:
                    c=max(len(str(N//j)),len(str(j)))
                    array.append(c)
                    break
        else:
            for j in range((10**(m+1))-1,(10**m)-1,-1):
                if N%j==0:
                    c=max(len(str(N//j)),len(str(j)))
                    array.append(c)
                    break
    return min(array)
print(wari(N))

Submission status: Runtime Error

Solution code:
def f(a,b):
  digit_a = digit_b=0
  
  while a:
    digit_a+=1
    a//=10
    
  while b:
    digit_b+=1
    b//=10
    
  return max(digit_a, digit_b)

n = int(input())

ans = n
for i in range(1, int((n+1)**0.5)):
  for n%i==0:
    n = min(n, f(i, n//i))
    
print(ans)

Submission status: Runtime Error

Solution code:
import math
N=int(input())
a=0
for i in range(1,1+math.ceil(math.sqrt(N))):
    if N%i==0 and i>a:
        a=i
b=int(N/a)
print(max([len(str(a)),len(str(b))]))9876543210

Submission status: Runtime Error

Solution code:
# C - Digits in Multiplication
n = int(input())
import math
ans = []
for i in range(1,int(math.sqrt(n))):
    if n%i == 0:
        ans.append(max(len(str(i)),len(str(int(n//i)))))
print(min(ans))

Submission status: Runtime Error

Solution code:
from itertools import combinations
from functools import reduce
from operator import mul
def prime_dec(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n /= i
      table.append(int(i))
    i += 1
  if n > 1:
    table.append(n)
  return table

n = int(input())
ps = prime_dec(n)
ps_com = []
for i in range(len(ps)):    
    ps_com += set(combinations(ps, i))
divs = [reduce(mul, k) for k in ps_com if not len(k) == 0]
divs_twin = [(k, int(n/k)) for k in divs]
divs_twin = set(divs_twin)
divs_twin_len = [max(len(str(k[0])) ,len(str(k[1])))  for k in divs_twin]

print(min(divs_twin_len))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
import math
input = sys.stdin.readline

N = int(input())
a = int(math.sqrt(N))

A = 0
B = 0
for i in reversed(range(1, a + 1)):
  if not N % i:
    A = i
    B = N // A
    break

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

Submission status: Runtime Error

Solution code:
import math
def main():
    N = int(input())
    count = 0
    for i in range(1,int(math.sqrt(N))):
        if N%i==0:
            iremono = i

    print(len(str(N//iremono)))
    

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
import numpy as np

def list_prime(max):
    primes = []
    for i in range(1, max):
        if max % i == 0:
            primes.append(i)
        if i >= np.sqrt(max):
            break
    if len(primes) == 1:
        primes.append(max)
    return primes

def solve(N: int):
    print(len(str(max(int(N / list_prime(N)[-1]), list_prime(N)[-1]))))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())


def digits(n):
    return len(list(str(n)))


digit_list = []
for a in range(1, int(N**(1/2))):
    b = N // a if N % a == 0 else 0
    if b != 0:
        digit_list += [max(digits(a), digits(b))]

print(min(digit_list))

Submission status: Runtime Error

Solution code:
from itertools import combinations

N = int(input())

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

A = factorize(N)

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

ans = min(list)

print(ans)

Submission status: Runtime Error

Solution code:
def d(n):
  return len(str(n))

N=int(input())
i=1
#print(int(N**0.5))
while N%(int(N**0.5)-i)!=0:
  i=i+1
print(max(d(int(N**0.5)-i),d(N//(int(N**0.5)-i))))

Submission status: Runtime Error

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

    #divisors.sort()
    return divisors

N = int(input())
list =  make_divisors(N)
ans = 10**9
for i in range(0,len(list),2):
  tmp1 = len(str(list[i]))
  tmp2 = len(str(list[i+1]))
  ans = min(ans,max(tmp1,tmp2))
print(ans)

Submission status: Runtime Error

Solution code:
from tqdm import tqdm
N = int(input())
ans = 0

for i in tqdm(range(N+1//2)):
  i += 1
  M = N//i
  if i*M == N:
    M = str(M)
    i = str(i)
    if len(M)>=len(i):
      if ans > len(i):
        ans = len(i)
        print(ans)
      else:
        ans = len(M)
        print(ans)
      i = int(i)
      M = int(M)
    else:
      i = int(i)
      M = int(M)
      
print(ans)

Submission status: Runtime Error

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

for i in range(l,1,-1):
    if n%i==0:
        a,b=i,n//i
        k=max(math.floor(math.log10(a))+1,math.floor(math.log10(b))+1)
        break
print(k)

Submission status: Runtime Error

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

for i in range(l,1,-1):
    if n%i==0:
        a,b=i,n//i
        x=max(math.floor(math.log10(a))+1,math.floor(math.log10(b))+1)
        break
print(k)

Submission status: Runtime Error

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

for i in range(1, int(n**0.5)+10):
    if n % i == 0:
        a.append(i)
        if i != n//i:
            b.append(n//i)

def Check(x):
    cont= 0
    while x > 0:
        x = x//10
        cont += 1
    return cont

A = []
for i in a:
    A.append(Check(i))

B = []
for i in b:
    B.append(Check(i))

print(max(max(A), min(B)))

Submission status: Runtime Error

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

for i in range(1, int(n**0.5)+1):
    if n % i ==0:
        a.append(i)
        if i != n//i:
            b.append(n//i)

def Check(x):
    cont= 0
    while x > 0:
        cont += 1
        x = x//10
    return cont

A = []
for i in a:
    A.append(Check(i))

B = []
for i in b:
    B.append(Check(i)) 

print(max(max(A), min(B)))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import heapq

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

A = prime_factorize(n)
heapq.heapify(A)

while len(A) > 2:
    a = heapq.heappop(A)
    b = heapq.heappop(A)
    heapq.heappush(A, a * b)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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