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

Solution code:
import numpy as np
N = int(raw_input())

def length(x):
    return int(np.floor(np.log10(x))) + 1

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

def EstimateRoot(y):
    return int(np.floor(np.sqrt(y)))
    
minF = 11
candidates = []
for i in xrange(EstimateRoot(N)):
    if N % (i + 1) == 0:
        candidates.append((i + 1, N/(i + 1)))
for c in candidates:
    f = F(c[0], c[1])
    if f < minF:
        minF = f
print minF

Submission status: Accepted

Solution code:
MAX = 100000


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

N = int(input())

res = 100
for a in range(1, MAX):
    if N % a == 0:
        res = min(res, F(a, N // a))

print(res)

Submission status: Accepted

Solution code:
N = int(input())

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

minf = float("inf")
for i in range(1,rN):
	if (N//i) * i == N:
		minf = min(minf,max(len(str(i)),len(str(N//i))))

print(minf)

Submission status: Accepted

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

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

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()


def main():
    n = I()
    s = int(math.sqrt(n))+1
    t = n
    for i in range(s,0,-1):
        if n % i == 0:
            t = max(n//i,i)
            break
    ti = 0
    while t > 0:
        ti += 1
        t //= 10
    return ti



print(main())

Submission status: Accepted

Solution code:
from math import sqrt,log10,floor

INF = 10 ** 10

n = int(input())

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

Submission status: Accepted

Solution code:
n = int(input())

ans = 1e10

for i in range(1,n+1):
	if i*i > n:
		break
	if n%i != 0:
		continue
	a = i
	b = n//i
	ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    N = int(input())
    if (N == 1):
        print (1)
        exit()
    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: Accepted

Solution code:
from math import sqrt


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

N = int(input())

best = 1<<30
for A in range(1, int(sqrt(N)) + 1):
    B = N // A
    if A * B != N:
        continue
    c = F(A, B)
    if best > c:
        best = c

print(best)

Submission status: Accepted

Solution code:
def divisor(x):
    div=[]
    for i in xrange(1,int(x**0.5)+1):
        if x%i==0:
            div.append(i)
            if i!=x/i:
                div.append(x/i)
    return div

n=int(raw_input())
ans=100
d=divisor(n)
for i in xrange(len(d)):
    a=str(d[i])
    b=str(n/d[i])
    ans=min(ans,max(len(a),len(b)))
print ans

Submission status: Accepted

Solution code:
import sys

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

    for a in range(1, N + 1):
        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: Accepted

Solution code:
def ri():
    return map(int, raw_input().split())

n = ri()[0]

ans = n
for i in xrange(1, int(n**0.5) + 10):
    if n % i == 0:
        ans = n / i

print len(str(ans))

Submission status: Accepted

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

def F(a, b):
    return max(keta(a), keta(b))

N = input()

i = 1
ans = float('inf')
while i * i <= N:
    if N % i == 0:
        ans = min(ans, F(i, N/i))
    i += 1
print ans

Submission status: Accepted

Solution code:
import sys

stdin = sys.stdin


def na(): return map(int, stdin.readline().split())


def ns(): return stdin.readline().strip()

n = int(ns())
i = 1
mi = n
while i*i <= n:
    if n % i == 0:
        x = n//i
        mi = min(mi, x)
    i += 1
print(len(str(mi)))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
s = 0
for i in range(1, n//2 + 1):
  if n % i == 0:
    s.append(max(len(str(i)), len(str(n//i))))
print(min(s))

Submission status: Runtime Error

Solution code:
import math

N=int(input())
num=(N**0.5)//1+1
num=int(num)
for i in range(num,N+1):
    if N%i==0:
        x=i
        break

ans=int((math.log(x,10)+1)//1)
print(ans)

Submission status: Runtime Error

Solution code:
def cal1(n):
    num=(n**0.5)//1+1
    for i in range(num,n+1):
        if n//i==0:
            num=i
            break
    return num

import math

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

Submission status: Runtime Error

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

for a in range(1, int(math.sqrt(n))):
    if n%a == 0:
        b = n//a
        ans = len(str(b))
print(ans)

Submission status: Runtime Error

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,math.sqrt(N)+1):
    if N % i == 0:
        ans = min(ans,f(i,N//i))
print(ans)

Submission status: Runtime Error

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/2)):
    if N % i == 0:
        ans = min(ans,f(i,N//i))
print(ans)

Submission status: Runtime Error

Solution code:
import sympy
url = "https://atcoder.jp//contests/abc057/tasks/abc057_c"

def main():
    n = int(input())
    ans = 10000000000000000
    ns = sympy.divisors(n)
    for i in range(0, (len(ns)//2) + 1):
        tmp = max(len(str(ns[i])), len(str(ns[len(ns)-i-1])))
        ans = tmp if tmp < ans else ans
    if len(ns) % 2 != 0:
            tmp = len(str(ns[len(ns) // 2]))
            ans = tmp if tmp < ans else ans
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N = int(input())

min_f = len(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: Runtime Error

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(key))

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

Submission status: Runtime Error

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(i), len(N//i)), min_num)
print(min_num)

Submission status: Runtime Error

Solution code:
import math

N = int(input())
P = 0
P += N
Eratosthenes = [p for p in range(2, math.ceil(N ** 0.5))]
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 P==1:
    print(1)
else:
    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: Runtime Error

Solution code:
import math
N=int(input())
P=0
P+=N
Eratosthenes = [p for p in range(2, math.ceil(N ** 0.5))]
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: Runtime Error

Solution code:
n=int(input())
a=list(map(int,input().split()))
color=[]
count,free=0,0

for i in range(n):
    c=a[i]//400
    if a[i]<3200 and c not in color:
        color.append(c)
        count+=1
    elif a[i]>=3200:
        free+=1
      
min,max=0,0
if count==0:
    max=free
    min=1
else:
    max=count+free
    min=count
    
print(min,max)

Submission status: Runtime Error

Solution code:
#include<bits/stdc++.h>
using namespace std;

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int64_t n; cin>>n;
	int ans=1e10;
	for(int64_t i=1;i*i<=n;++i){
		if(n%i==0){
			int64_t t=max(n/i,i);
			int tans=0;
			while(t){
				t/=10;
				++tans;
			}
			ans=min(ans,tans);
		}
	}
	cout<<ans<<"\n"s;
}

Submission status: Runtime Error

Solution code:
n = int(raw_input())
m = len(str(n))
for a in range(2, n ** 0.5 + 1):
	if n % a == 0:
		m = min(m, max(len(str(a)), len(str(n/a))))
print m

Submission status: Runtime Error

Solution code:
N = int(input()) 
ans = 111111111110
for i in range(int(N**0.5+2)):
    if N%i == 0:
        use = N//i 
        s = str(use) 
        t = str(i) 
        ans = min(ans, max(len(s), len(t))) 

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
r_N = int(N ** (1 / 2))
 
li = []
for n in range(1,r_N + 1):
  if N % n == 0:
    a = N // n
    l = max(len(str(a)),len(str(n)))
  	li.append(l)
    
print(min(li))

Submission status: Runtime Error

Solution code:
N = int(input())
r_N = int(N ** (1 / 2))

li = []
for n in range(1,r_N + 1):
  if N % n == 0:
    a = N // n
    l = max(len(str(a)),len(str(n))))
  	li.append(l)
    
print(min(li))

Submission status: Runtime Error

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]
import math

n = int(input())

ans = []

nj = int(math.sqrt(n))
for i in range(1,nj):
    a = i
    if n % a == 0:
        b = n // a
        tmp = max(len(str(a)), len(str(b)))
        #print(a,b)
        ans.append(tmp)
print(min(ans))

Submission status: Runtime Error

Solution code:
import math
import sympy
#from sympy import sieve

N = int(input())
'''
lenN = math.floor(math.log(N,10)) + 1
# lenN = Nの桁数
rootN = math.floor(math.sqrt(N))
#rootN = floor( N ^ 1/2 )
Primes = list(sieve.primerange(1,rootN))
'''

Divisors = list(sympy.divisors(N))
Len_d = len(Divisors)

Ans = Divisors[ Len_d // 2 ]
print(math.floor(math.log(Ans,10))+1)

Submission status: Runtime Error

Solution code:
n = int(input())

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

results = []

for i in range(1, (n // 2) + 1):
    if n % i == 0:
        a = i
        b = n / i
    result = f(a, b)
    results.append(result)

print(min(results))

Submission status: Runtime Error

Solution code:
n = int(input())

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

results = []

for i in range(1, (n // 2) + 1):
    if n % i == 0:
        a = i
        b = int(n / i)
    result = f(a, b)
    results.append(result)

print(min(results))

Submission status: Runtime Error

Solution code:
n=int(input())

for a in range(1,n**0.5+1):
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        if a<=b:
             ans=len(sb)
        else:
            break

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

for i in range(1,n//2+1):
    a=i
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        
        #print(a,b,len(sa),len(sb))
        if len(sb)-len(sa)==0:
            ans=len(sb)
            break
        elif len(sb)-len(sa)>=1:
             ans=len(sb)
        else:
            #print(b,sb,len(sa),len(sb))
            break

print(ans)

Submission status: Runtime Error

Solution code:
n=int(input())

for i in range(1,(n)//2+1):
    a=i
    if n%a==0:
        b=n//a
        sa=str(a)
        sb=str(b)
        
        #print(a,b,len(sa),len(sb))
        if len(sb)-len(sa)>=0:
            ans=len(sb)
        else:
            #print(b,sb,len(sa),len(sb))
            break

print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math
N=int(input())
ans=len(str(N))
for a in range(2,math.sqrt(N**0.5)+1):
    if N%a==0:
        b=N//a
        ans=min(ans,len(str(b)))
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
res = []
import sympy
for a in sympy.divisors(N):
  b = int(N/a)
  if a*b == N:
    a = str(a)
    b = str(b)
    if len(a) > len(b):
      res.append(len(a))
    else:
      res.append(len(b))

res.sort()
print(res[0])

Submission status: Runtime Error

Solution code:
N = int(input())
res = []

import sympy


for a in sympy.divisors(N):
  b = int(N/a)
  if a*b == N:
    a = str(a)
    b = str(b)
    if len(a) > len(b):
      res.append(len(a))
    else:
      res.append(len(b))

res.sort()
print(res[0])

Submission status: Runtime Error

Solution code:
N = int(input())
res = []

for a in range(1, N):
  b = int(N/a)
  if a*b == N:
    a = str(a)
    b = str(b)
    if len(a) > len(b):
      res.append(len(a))
    else:
      res.append(len(b))

res.sort()
print(res[0])

Submission status: Runtime Error

Solution code:
N = int(input())
res = []

for a in range(1, N):
  for b in range(1, int(N/a)+1):
    if a*b == N:
      a = str(a)
      b = str(b)
      if len(a) > len(b):
        res.append(len(a))
      else:
        res.append(len(b))

res.sort()
print(res[0])

Submission status: Runtime Error

Solution code:
N = int(input())
import math
if N == 1:
    print(1)
else:
    for a in reversed(range(1, (int(math.sqrt(N)))+1)):
        if N % a == 0:
            b = N/a
            ans=max(len(str(int(a))), len(str(int(b))))
            break
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

if N == 1:
    print(1)
else:
    for a in reversed(range(1, (N//2)+1)):
        if N % a == 0:
            b = N/a
            ans=max(len(str(int(a))), len(str(int(b))))
            break
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())
I = int(math.sqrt(N) // 1)
print(I)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    k = len(str(i))
    l = len(str(j))
    m = max(k, l)
    a.append(int(m))
print(min(a))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
I = int(math.sqrt(N) // 1)
print(I)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    k = len(list(str(i)))
    l = len(list(str(j)))
    m = max(k, l)
    a.append(m)
print(min(a))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
I = int(math.sqrt(N) // 1)

a = []
for i in range(1, I):
  if N%i==0:
    j=N//i
    i = len(list(str(i)))
    j = len(list(str(j)))
    k = max(i, j)
    a.append(k)
print(min(a))

Submission status: Runtime Error

Solution code:
import math

n = int(input())
l = []
for i in range(1, int(math.sqrt(n))):
    if n % i == 0:
        a = len(str(int(n / i)))
        b = len(str(int(i)))
        l.append(max(a, b))

print(min(l))

Submission status: Runtime Error

Solution code:
N = int(input())

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

Submission status: Runtime Error

Solution code:
N = int(input())

y = []

for i in range(1, N//2):
    if N % i == 0:
        y.append( max( len(str(i)),  len(str(int(N/i))) ) )
print(min(y))

Submission status: Runtime Error

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

div = sympy.divisors(N)
ans = 100

for i in range(len(div)):
    a = div[i]
    b = N // a
    ans = min(ans, max(len(str(a)), len(str(b))))
print(ans)

Submission status: Runtime Error

Solution code:
N=int(input())
list = []
flg = True
for A in range(1,int((N+1)**0.5)):
    for B in range(int((N+1)**0.5),N+1):
        if A*B==N:
            list.append(len(str(B)))
list.sort()
print((list[0]))

Submission status: Runtime Error

Solution code:
N=int(input())
list = []
flg = True
for A in range(1,int((N+1)**0.5)):
    for B in range(1,N+1):
        if A*B==N:
            if len(str(A)) > len(str(B)):
                list.append(len(str(A)))
                print(list)
            else:
                list.append(len(str(B)))

        #print(list)
list.sort()
print((list[0]))

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())

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

l = prime(N)

sqrt = str(int(math.sqrt(N)))
print(max(len(sqrt),len(str(l[-1]))))

Submission status: Runtime Error

Solution code:
n = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

sosu = make_divisors(n)
#print(type(sosu))
kumi = []
for i in range(len(sosu)):
  for j in range(len(sosu)):
    #print(type(sosu[i]))
    if sosu[i]*sosu[j] == n:
      kumi.append([str(sosu[i]), str(sosu[j])])
if len(kumi)%2 == 0:
  print(len(min(kumi[len(kumi)/2])))
else:
  print(len(min(kumi[round(len(kumi)/2)])))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

L = make_divisors(N)
l = len(L)
if l % 2 == 0:
    a1 = str(L[l // 2] - 1)
    a2 = str(L[l // 2])
    print(max(len(a1), len(a2)))
else:
    a1 = str(L[l // 2 - 1])
    a2 = str(L[l // 2])
    a3 = str(L[l // 2 + 1])
    print(max(len(a1), len(a2), len(a3)))

Submission status: Runtime Error

Solution code:
N = int(input())


def digit(N):
    d = 0
    while N >= 1:
        N /= 10
        d += 1
    return d


f = []
for i in range(1, N):
    if i * i > N:
        break
    if N % i == 0:
        d1 = digit(i)
        d2 = digit(int(N/i))
        f.append(max(d1, d2))

print(min(f))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def make_divisors(n): #約数列挙の関数を一部改変
    lower_divisors , upper_divisors = [], [] 
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    if i == 1:
        return 1
    else:
        return upper_divisors[-1]

N = int(readline())
ans = make_divisors(N)
print(len(str(ans)))

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
import sys 
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def make_divisors(n): #約数列挙の関数を一部改変
    lower_divisors , upper_divisors = [], [] 
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return upper_divisors[-1]

N = int(readline())
ans = make_divisors(N)
print(len(str(ans)))

Submission status: Runtime Error

Solution code:
import math
N=int(input())
frac=[]
result=len(str(N))
for i in range(1,math.ceil(math.sqrt(N))):
  if N%i==0:
    frac.append(len(str(int(N/i))))

print(min(frac))

Submission status: Runtime Error

Solution code:
N=int(input())

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

    if(N<i**2):
        break
print(ans)

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
elif len(div_arr) == 2:
    ans_num = max(div_arr)
    print(len(str(ans_num)))
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
if len(div_arr) == 2:
    ans_num = max(div_arr)
    print(len(str(ans_num)))
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
if len(div_arr) == 2:
    ans_num = max(div_arr)
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
if len(div_arr) == 2:
    ans_num = max(div_arr)
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            print(div_arr)
            print(div_arr[i] * div_arr[last_idx])
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        print(div_arr)
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Submission status: Runtime Error

Solution code:
import sympy
N = int(input())
div_arr = sympy.divisors(N)

if len(div_arr) == 1:
    print(1)
if len(div_arr) == 2:
    ans_num = max(div_arr)
    print(len(str(ans_num)))
else:
    memo = []
    if len(div_arr) % 2 == 0:
        last_idx = -1
        count = 0
        for i in range(len(div_arr)):
            print(div_arr)
            print(div_arr[i] * div_arr[last_idx])
            count += 1
            if N == div_arr[i] * div_arr[last_idx] and count != len(div_arr) // 2:
                last_idx -= 1
                memo.append(len(str(div_arr[last_idx])))
            else:
                break
    else:
        print(div_arr)
        target_index = len(div_arr) // 2
        memo.append(len(str(div_arr[target_index])))
    print(min(memo))

Submission status: Runtime Error

Solution code:
import math
#N=int(input())
#考えるべき範囲
ans=11
#絶対ありえない数を定義しておく
for i in range(1,int(math.sqrt(N))+1):
    if N%i !=0:
        continue
    else:
        A=N//i
        A=str(A)
        i=str(i)
        F=max(len(A),len(i))
        if F<ans:
            ans=F

print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())

min_len = len(n)
for i in range(1,n+1):
  for j in range(1,n+1):
    if n%i != 0 or n%j !=0:
      break
    if i*j > n:
      break
    if n == i*j:
      if max(len(str(i)),len(str(j))) < min_len:
        min_len = max(len(str(i)),len(str(j)))
        break
        
print(min_len)

Submission status: Runtime Error

Solution code:
N = int(input())
count = []

for a in range(1,N//2+1):
    if N % a == 0:
        b = N // a
        count.append(max(len(str(a)),len(str(b))))

print(min(count))

Submission status: Runtime Error

Solution code:
N = int(input())
A = []
for i in range(int(N**0.5)):
  if N%(i+1) == 0:
    A.append(i)
print(len(str(int(N/A[-1]))))

Submission status: Runtime Error

Solution code:
N = int(input())

def m(A,B):
  a = min(len(str(A)),len(str(B)))
  return a

min_a = 0
for i in 1000:
	for j in 1000:
      if N == i*j:
        min_a = m(i*j,min_a)
        
print(min_a)

Submission status: Runtime Error

Solution code:
import math
n = int(input())
k = int(math.sqrt(n))
for i in range(k+2,1,-1):
  if n%i == 0:
    a = n//i
    break
s = len(str(a))
print(s)

Submission status: Runtime Error

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(int(math.log(a,10))+1)
k = int(math.sqrt(n))
for i in range(k,n+1):
  if n%i == 0:
    a = i
    break
s = int(math.log(a,10))+1
print(s)

Submission status: Runtime Error

Solution code:
N = int(input())
x = int(n**.5)
while N%x:
  x-=1

print(len(str(N//x)))

Submission status: Runtime Error

Solution code:
N = int(input())
x = int(n**.5)
while n%x:
  x-=1

print(len(str(n//x)))

Submission status: Runtime Error

Solution code:
import math
s = list(map(int, input().split()))
n=s[0]
ans=math.inf
for a in range(1,int(math.sqrt(n))):
    b=n/a
    if b.is_integer():
        b=int(b)
        if max(len(str(a)),len(str(b)))<ans:
            ans = max(len(str(a)), len(str(b)))
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

sosuu = 1
for i in range(1,int(math.sqrt(N+1))):
    if N % i == 0:
        sosuu = i
        B = N // i

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

Submission status: Runtime Error

Solution code:
import math

N = int(input())

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

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