ZhenlongDai/ACPR huggingface dataset:
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def F(a, b):
    count = 0
    c = max(a, b)
    while c > 9:
        c = c / 10
        count += 1
    return count+1

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

Failing test case input:
4625887173

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1

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

Problem: p03775
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
ans=1
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        ans=i
print(len(str(ans)))
    

Failing test case input:
1784609950

Expected output:
6


Actual output:
4


Fixed submission (verdict: Accepted):
n=int(input())
ans=1
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        ans=i
print(len(str(n

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

if n % a == 0.0:
    b = int(math.log10(a)) + 1
    print(b)
else:
    a = int(a)
    while n % a != 0:
        a = a -1
    b = int(math.log10(a)) + 1
    print(b)

Failing test case input:
1747602376

Expected output:
6


Actual output:
4


Fixed submission (verdict: Accepted):
import math


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

if n % a == 0.0:
    b = int(math.log10(a)) + 1
    print(b)
else:
    a = int(a)
    for i in range(a, 0, -1):
    	if n % i == 0:
    		a = n / i
    		break
    b = int(math.log10(a)) + 1
    print(b)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
x = 10**5
for i in range(1,int(n**0.5)+1):
    if n % i == 0:
        x = min(x,int(n/i))
cnt = 1
while x >= 10:
    x = x / 10
    cnt += 1
print(cnt)

Failing test case input:
16905846298

Expected output:
8


Actual output:
6


Fixed submission (verdict: Accepted):
n = int(input())
x = 10**10
for i in range(1,int(n**0.5)+1):
    if n % i == 0:
        x = min(x,int(n/i))

for i in range(10):
    if x <10**(i+1) and x >= 10**i:
        print(i+1)
        break

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
a = 0
t = 0
for i in range(1, n+1):
    a = n / i
    if(n % i == 0):
        t = i
    if(a <= i):
        break

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



Failing test case input:
10000

Expected output:
3

Actual output:
2


Fixed submission (verdict: Accepted):
n = int(input())
a = 0
t = 0
for i in range(1, n+1):
    a = n / i
    if(n % i == 0):
        t = i
    if(a <= i):
        break

b = max(int(n / t), t)
ans = 0
while(b >= 1):
    ans += 1
    b /= 10
print(ans)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):


import math
N = int(input())

def main(n):
    sqrt_n = math.sqrt(n)
    min_keta = len(str(n))
    for i in range(1,(int(sqrt_n)+1)):
        if n % i == 0:
            c = len(str(max(i,n/i)))
            if c < min_keta:
                min_keta = c
    print(min_keta)
main(N)

Failing test case input:
101914

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):


import math
N = int(input())

def main(n):
    sqrt_n = math.sqrt(n)
    min_keta = len(str(n))
    for i in range(1,int(sqrt_n)+1):
        if n % i == 0:
            j = int(n/i)
            max_num = max(i,j)
            c = len(str(max_num))
            if c < min_keta:
                min_keta = c
    print(min_keta)
main(N)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N=int(input())
import math
rootN=math.sqrt(N)
if rootN==int(rootN):
    n=int(rootN)
else:
    for m in reversed(range(1,int(rootN)+1)):
        if N%m==0:
            n=m
            break
print(len(str(n)))


Failing test case input:
1108

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
N=int(input())
import math
rootN=math.sqrt(N)
if rootN==int(rootN):
    n=int(rootN)
else:
    for m in reversed(range(1,int(rootN)+1)):
        if N%m==0:
            n=int(N/m)
            break
print(len(str(n)))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    
    s = input()

    x = len(s)
    limit = int(x/2)+1 if x % 2 == 0 else int(x/2)+2
    limit2 = int(x/2) if x % 2 == 0 else int(x/2)+1

    n = int(s)

    min_l = 10

    
    for i in range(1, n+1):
        
        il = len(str(i))
        if il == limit:
            break
        if n % i != 0:
            continue
        if il == min_l:
            break
        j = int(n / i)

        jl = len(str(j))
        f = max(il, jl)
        if f < min_l:
            min_l = f
        if il == limit2 or il == jl or il > jl:
            break


    
    print(min_l)


main()


Failing test case input:
5964

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
def main():
    
    s = input()

    x = len(s)
    limit = int(x/2)+1 if x % 2 == 0 else int(x/2)+2
    limit2 = int(x/2) if x % 2 == 0 else int(x/2)+1

    n = int(s)

    min_l = 11

    
    for i in range(1, n+1):
        
        il = len(str(i))
        if il == limit:
            break
        if n % i != 0:
            continue
        if il == min_l:
            break
        j = int(n / i)

        jl = len(str(j))
        f = max(il, jl)
        if f < min_l:
            min_l = f
        if jl == limit2 or il == jl or il > jl:
            break


    
    print(min_l)


main()
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
m = int(math.sqrt(N)+1)
print(m)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)


Failing test case input:
190346

Expected output:
4


Actual output:
437
4


Fixed submission (verdict: Accepted):
import math
N = int(input())
m = int(math.sqrt(N)+1)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())

a = math.ceil(N ** (1/2))

for i in range(a):
  if int(N % (a-i)) == 0:
    a = len(list(str(int(a-i))))
    b = len(list(str(int(N % (a-i)))))
    
    break

print(min(a,b))

Failing test case input:
101914

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
import math

N = int(input())

a = math.ceil(N ** (1/2))

for i in range(a):
  if int(N % (a-i)) == 0:
    aa = len(list(str(int(a-i))))
    bb = len(list(str(int(N 
    break

print(max(aa,bb))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

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

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

ans = 1

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

print(ans)



Failing test case input:
53937807463

Expected output:
10


Actual output:
1


Fixed submission (verdict: Accepted):
import math

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

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

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

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

print(ans)

Problem: p03775
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
N = int(input())

for i in range(1,int(N**0.5)+1):
  ans = 10
  ans = min(ans,max(len(str(i)),len(str(N/i))))

print(ans)

Failing test case input:
10010

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
N = int(input())
ans = 1
for i in range(1,int(N**0.5)+1):
    if N%i == 0:
        ans = max(ans,i)
print(len(str(int(N/ans))))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(a, b):
    al = len(str(a))
    bl = len(str(b))
    if al > bl:
        return al
    return bl
N = int(input())
n = int(N**0.5)
result = len(str(N))
for a in range(1, n+1):
    if N % a != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)


Failing test case input:
619233107

Expected output:
7


Actual output:
9


Fixed submission (verdict: Accepted):
def f(a, b):
    al = len(str(int(a)))
    bl = len(str(int(b)))
    if al > bl:
        return al
    return bl
N = int(input())
result = len(str(N))
for a in range(1, N):
    if a*a > N:
        break
    if (N % a) != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

n = int(input())

N = math.ceil(math.sqrt(n))

ans = 10**10

for a in range(N):
    try:
        amari = n%a
        if amari == 0:
            b = int(n / a)
            f = max(len(str(a)),len(str(b)))
            ans = min(f,ans)
    except ZeroDivisionError:
        print(1)
        exit()

print(ans)

    
    

    


Failing test case input:
120106

Expected output:
3


Actual output:
1


Fixed submission (verdict: Accepted):
import math

n = int(input())

N = math.ceil(math.sqrt(n))

ans = 10**10

if n == 1:
    print(1)
    exit()

for a in range(1,N+1):
    amari = n%a
    if amari == 0:
        b = int(n / a)
        f = max(len(str(a)),len(str(b)))
        ans = min(f,ans)

print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

n = int(input())
counter = 0

for i in range(int(math.sqrt(n)), 0, -1):
  if n % (i + 1) == 0:
    j = int(n / (i + 1))
    _keta = max(len(str(i + 1)), len(str(j)))
    print(_keta)
    break


Failing test case input:
15607

Expected output:
5


Actual output:

Fixed submission (verdict: Accepted):

import math

n = int(input())
counter = 0

for i in range(int(math.sqrt(n)), 0, -1):
  if n % i == 0:
    j = int(n / i)
    _keta = max(len(str(i)), len(str(j)))
    print(_keta)
    break

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n=int(input())
f=[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        f.append(i)
        f.append(int(n/i))
print(f)
if n==1:
    print('1')
else:
    print(len(str(f[-1])))


Failing test case input:
5964

Expected output:
2


Actual output:
[1, 5964, 2, 2982, 3, 1988, 4, 1491, 6, 994, 7, 852, 12, 497, 14, 426, 21, 284, 28, 213, 42, 142, 71, 84]
2


Fixed submission (verdict: Accepted):
n=int(input())
f=[]
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        f.append(i)
        f.append(int(n/i))
if n==1:
    print('1')
else:
    print(len(str(f[-1])))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
d = int(math.sqrt(N))
while d < N:
    q, m = divmod(N, d)
    if m == 0:
        break
    if q < m:
        d += int(m / q)
    d += 1
print(len(str(d)))


Failing test case input:
18085

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
import math
N = int(input())
for i in range(int(math.sqrt(N)) + 1, 0, -1):
    q, m = divmod(N, i)
    if m == 0:
        print(len(str(q)))
        break

Problem: p03775
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n=int(input())
ans=1
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        ans=i
print(len(str(n/ans)))
    

Failing test case input:
517145

Expected output:
4


Actual output:
6


Fixed submission (verdict: Accepted):
n=int(input())
ans=1
for i in range(1,int(n**0.5)+1):
    if n%i==0:
        ans=i
print(len(str(n
Problem: p03775
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)


Failing test case input:
414

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import math
N = int(input())
rt = 0
A = int(math.sqrt(N))
for i in range(A,0,-1):
    if N % i == 0:
      rt = len(str(N
      break
print(rt)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
import sys 

n = int(input())

n = math.ceil(math.sqrt(n))

ans = 100000000000000000000000000000000000000000000000000

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

print(ans)

    
    

    


Failing test case input:
2771679283

Expected output:
9


Actual output:
4


Fixed submission (verdict: Accepted):
import math

n = int(input())

N = math.ceil(math.sqrt(n))

ans = 10**10

if n == 1:
    print(1)
    exit()

for a in range(1,N+1):
    amari = n%a
    if amari == 0:
        b = int(n / a)
        f = max(len(str(a)),len(str(b)))
        ans = min(f,ans)

print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
m = int(math.sqrt(N)+1)
print(m)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)

Failing test case input:
984724511

Expected output:
5


Actual output:
31381
5


Fixed submission (verdict: Accepted):
import math
N = int(input())
m = int(math.sqrt(N)+1)
for i in range(m):
  if N % (m-i) == 0:
    j = int(N/(m-i))
    num = len(str(j))
    break
print(num)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

if __name__ == '__main__':
    N = int(input())
    val = N
    li = []
    for i in range(1, math.ceil(math.sqrt(N))+1):
        if N % i == 0:
            a = len(str(int(i)))
            b = len(str(int(N/i)))
            print(a, b)
            c = max(a, b)

            if c < val:
                val = c

    print(val)


Failing test case input:
4020311016

Expected output:
5


Actual output:
1 10
1 10
1 10
1 10
1 9
1 9
1 9
2 9
2 9
2 9
2 9
2 9
2 8
2 8
3 8
3 8
3 8
3 8
3 8
3 8
3 7
3 7
3 7
3 7
3 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 7
4 6
4 6
4 6
4 6
4 6
4 6
4 6
4 6
4 6
4 6
4 6
5 6
5 6
5 6
5 6
5 6
5 6
5 6
5 6
5 6
5 6
5 5
5 5
5 5
5


Fixed submission (verdict: Accepted):

import math

if __name__ == '__main__':
    N = int(input())
    val = len(str(N))
    li = []
    for i in range(1, math.ceil(math.sqrt(N))+1):
        if N % i == 0:
            a = len(str(int(i)))
            b = len(str(int(N/i)))
            c = max(a, b)

            if c < val:
                val = c

    print(val)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

def get_number_of_digits(n):
    return int(math.log10(n) + 1)

def get_larger_digits(a, b):
    return max(get_number_of_digits(a), get_number_of_digits(b))

n = 10000
max_digit = float('inf')
for a in range(1, n):
    if n % a == 0:
        continue
    b = int(n / a)
    temp_digit = get_larger_digits(a, b)
    max_digit = min(max_digit, temp_digit)
print(max_digit)

Failing test case input:
748

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):

import math

def get_number_of_digits(n):
    return int(math.log10(n) + 1)

def get_larger_digits(a, b):
    return max(get_number_of_digits(a), get_number_of_digits(b))

n = int(input())
min_digit = float('inf')
for a in range(1, int(math.sqrt(float(n))+5.0)):
    if n % a != 0:
        continue
    b = int(n / a)
    if n == a * b:
        temp_digit = get_larger_digits(a, b)
        min_digit = min(min_digit, temp_digit)
print(min_digit)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())
min_f = 10
for n in range(1, int(math.sqrt(N))):
    a = n
    if N % n != 0:
        continue
    b = N / n
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)

Failing test case input:
10111

Expected output:
5


Actual output:
7


Fixed submission (verdict: Accepted):
import math

N = int(input())
min_f = 10
for n in range(1, int(math.sqrt(N)) + 1):
    a = n
    if N % n != 0:
        continue
    b = int(N / n)
    f = max(len(str(a)), len(str(b)))
    min_f = min(min_f, f)
print(min_f)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

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

res = check(1, N)
print('first-res',res,n)
i = 1
while i <= n:
  if N % i == 0:
    res = min(res, check(i,int(N / i)))

  i += 1

print(res)

Failing test case input:
1165187166

Expected output:
6


Actual output:
first-res 10 34134
6


Fixed submission (verdict: Accepted):
N = int(input())

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

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

res = check(1, N)

i = 1
while i <= n:
  if N % i == 0:
    res = min(res, check(i,int(N / i)))
  i += 1

print(res)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())
N_max = math.floor(pow(N, 0.5))

ans = math.floor(math.log10(N))

for i in range(1, N_max+1):
    if N % i == 0:
        M = N / i
        digI = math.floor(math.log10(i)) + 1
        digM = math.floor(math.log10(M)) + 1
        if digI >= digM:
            score = digI
        else:
            score = digM

        if score <= ans:
            ans = score

print(ans)

Failing test case input:
14831

Expected output:
5


Actual output:
4


Fixed submission (verdict: Accepted):
import math

N = int(input())
N_max = math.floor(pow(N, 0.5))

ans = math.floor(math.log10(N)) + 1

for i in range(1, N_max+1):
    if N % i == 0:
        M = N / i
        digI = math.floor(math.log10(i)) + 1
        digM = math.floor(math.log10(M)) + 1
        if digI >= digM:
            score = digI
        else:
            score = digM

        if score <= ans:
            ans = score

print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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


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

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


if __name__ == '__main__':
    main()


Failing test case input:
1933005141

Expected output:
5


Actual output:
1 10
3 9
9 9
27 8
59 8
67 8
81 8
177 8
201 7
531 7
603 7
1593 7
1809 7
3953 6
4779 6
5427 6
6037 6
11859 6
18111 6
35577 5
5


Fixed submission (verdict: Accepted):
import math

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


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

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


if __name__ == '__main__':
    main()

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

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

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

ans = 0

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

Failing test case input:
53937807463

Expected output:
10


Actual output:
0


Fixed submission (verdict: Accepted):
import math

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

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

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

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

print(ans)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math

if __name__ == '__main__':
    N = int(input())
    val = len(str(N))
    li = []
    for i in range(1, math.ceil(math.sqrt(N))+1):
        if N % i == 0:
            a = len(str(int(i)))
            b = len(str(int(N/i)))
            print(a, b)
            c = max(a, b)

            if c < val:
                val = c

    print(val)


Failing test case input:
1634271104

Expected output:
5


Actual output:
1 10
1 9
1 9
1 9
2 9
2 8
2 8
2 8
2 8
2 8
3 8
3 8
3 8
3 7
3 7
3 7
3 7
3 7
4 7
4 6
4 6
4 6
4 6
4 6
4 6
4 6
4 6
5 6
5 6
5 5
5 5
5 5
5


Fixed submission (verdict: Accepted):

import math

if __name__ == '__main__':
    N = int(input())
    val = len(str(N))
    li = []
    for i in range(1, math.ceil(math.sqrt(N))+1):
        if N % i == 0:
            a = len(str(int(i)))
            b = len(str(int(N/i)))
            c = max(a, b)

            if c < val:
                val = c

    print(val)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())

def F_ab(a, b):
    a_len = len(str(a))
    b_len = len(str(b))
    
    if(a_len >= b_len):
        return a_len
    else:
        return b_len
    
n = math.floor(N ** (1/2))

min_f = 999999999999
for a in range(1, n + 1):
    b = N/a
    b = math.floor(b)
    f = F_ab(a, b)
    if(min_f > f):
        min_f = f
        
print(min_f)

Failing test case input:
9870

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
import math
N = int(input())
a_a = 0
b_b = 0
def F_ab(a, b):
    a_len = len(str(a))
    b_len = len(str(b))
    
    if(a_len >= b_len):
        return a_len
    else:
        return b_len
    
n = math.floor(N ** (1/2))

min_f = 99999999999999
for a in range(1, n + 1):
    if(N % a == 0):
        b = math.floor(N/a)
        f = F_ab(a, b)
        if(min_f > f):
            min_f = f
            a_a = a
            b_b = b
        
print(min_f)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N=int( input())
for r in range (int(math.sqrt(N)),0,-1):
  if N%r==0:
    count=1
    l=N/r
    for i in range (0,9):
      l=l/10
      if l<1:
        print(count)
        break
      count+=1
    break

Failing test case input:
53937807463

Expected output:
10


Actual output:

Fixed submission (verdict: Accepted):
import math
N=int( input())
for r in range (int(math.sqrt(N)),0,-1):
  if N%r==0:
    count=1
    l=N/r
    for i in range (0,10):
      l=l/10
      if l<1:
        print(count)
        break
      count+=1
    break

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n=int(input())
a=int(math.sqrt(n))
ans=len(str(n))
for i in range(1,a+1):
  if n%i==0:
    cand=len(str(max(i,n/i)))
    if ans>cand:
      ans=cand
print(ans)

Failing test case input:
75132

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
import math
n=int(input())
a=int(math.sqrt(n))
ans=len(str(n))
for i in range(1,a+1):
  if n%i==0:
    cand=len(str(max(i,int(n/i))))
    if ans>cand:
      ans=cand
print(ans)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

ans = [1]
for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        tmp = max(len(str(i)), len(str(int(N/i))))
        ans.append(tmp)

print(min(ans))


Failing test case input:
10111

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
N = int(input())

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

if N == 1:
    print("1")
else:
    print(len(str(ans[-1])))

Problem: p03775
Buggy submission (PyPy3 (2.4.0), verdict: Wrong Answer):
n = int(input())

root_n = n**0.5
if (root_n != int(root_n)):
    root_n = int(root_n)+1
else:
    root_n = int(root_n)    

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

Failing test case input:
10605

Expected output:
3


Actual output:
101 105
3


Fixed submission (verdict: Accepted):
n = int(input())

root_n = n**0.5
if (root_n != int(root_n)):
    root_n = int(root_n)+1
else:
    root_n = int(root_n)    

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

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
import math
r = math.sqrt(n)
l1 = []
l2 = []
for i in range(1, int(r+1)):
    if n % i == 0:
        a = i
        b = n / i
        if a <= b:
            l1.append([str(a), str(int(b))])
print(l1)

for j in l1:
    u = j[0]
    v = j[1]
    if len(u) >= len(v):
        f = len(j[0])
    else:
        f = len(j[1])
    l2.append(f)

print(min(l2))


Failing test case input:
2182

Expected output:
4


Actual output:
[['1', '2182'], ['2', '1091']]
4


Fixed submission (verdict: Accepted):
n = int(input())
import math
r = math.sqrt(n)
l1 = []
l2 = []
for i in range(1, int(r+1)):
    if n % i == 0:
        a = i
        b = n / i
        if a <= b:
            l1.append([str(a), str(int(b))])

for j in l1:
    u = j[0]
    v = j[1]
    if len(u) >= len(v):
        f = len(u)
    else:
        f = len(v)
    l2.append(f)

print(min(l2))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math,sys
N=int( input())
if N==0:
  print(1)
  sys.exit()
for r in range (int(math.sqrt(N)),0,-1):
  if N%r==0:
    count=1
    l=N/r
    for i in range (0,9):
      l=l/10
      if l<1:
        print(count)
        break
      count+=1
    break

Failing test case input:
53937807463

Expected output:
10


Actual output:

Fixed submission (verdict: Accepted):
import math
N=int( input())
for r in range (int(math.sqrt(N)),0,-1):
  if N%r==0:
    count=1
    l=N/r
    for i in range (0,10):
      l=l/10
      if l<1:
        print(count)
        break
      count+=1
    break
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

score = len(str(N))

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


Failing test case input:
16116

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
N = int(input())

score = len(str(N))

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

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
N = int(input())

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

y = int(N/x[-1])
print(y)
print(len(str(y)))


Failing test case input:
607

Expected output:
3


Actual output:
607
3


Fixed submission (verdict: Accepted):
N = int(input())

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

y = int(N/x[-1])
print(len(str(y)))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def F(a, b):
    count = 0
    c = max(a, b)
    while c > 9:
        c = c / 10
        count += 1
    return count+1

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

Failing test case input:
7479929988

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
def F(a, b):
    count = 0
    c = max(a, b)
    while c >= 10:
        c = c / 10
        count += 1
    return count+1

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

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):

import math
N = int(input())
yakusuu = []

for i in range(1, math.ceil(N ** (1/2))+1):
    if N % i == 0:
        yakusuu.append([i, int(N/i)])
keta1 = 0
keta2 = 10 ** 10
for i in yakusuu:
    if len(str(i[0])) > keta1 and len(str(i[1])) < keta2:
        keta1 = len(str(i[0]))
        keta2 = len(str(i[1]))
print(max(keta1, keta2))

Failing test case input:
10110

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):

import math
N = int(input())
yakusuu = []

for i in range(1, math.ceil(N ** (1/2))+1):
    if N % i == 0:
        yakusuu.append([i, int(N/i)])
keta1 = 0
keta2 = 10 ** 10
for i in yakusuu:
    if len(str(i[0])) >= keta1 and len(str(i[1])) <= keta2:
        keta1 = len(str(i[0]))
        keta2 = len(str(i[1]))
print(max(keta1, keta2))
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def main():
    
    s = input()

    x = len(s)
    limit = int(x/2)+1 if x % 2 == 0 else int(x/2)+2
    limit2 = int(x/2) if x % 2 == 0 else int(x/2)+1

    n = int(s)

    min_l = 11

    
    for i in range(1, n+1):
        
        il = len(str(i))
        if il == limit:
            break
        if n % i != 0:
            continue
        if il == min_l:
            break
        j = int(n / i)

        jl = len(str(j))
        f = max(il, jl)
        if f < min_l:
            min_l = f
        if il == limit2 or il == jl or il > jl:
            break


    
    print(min_l)


main()


Failing test case input:
87908940

Expected output:
4


Actual output:
5


Fixed submission (verdict: Accepted):
def main():
    
    s = input()

    x = len(s)
    limit = int(x/2)+1 if x % 2 == 0 else int(x/2)+2
    limit2 = int(x/2) if x % 2 == 0 else int(x/2)+1

    n = int(s)

    min_l = 11

    
    for i in range(1, n+1):
        
        il = len(str(i))
        if il == limit:
            break
        if n % i != 0:
            continue
        if il == min_l:
            break
        j = int(n / i)

        jl = len(str(j))
        f = max(il, jl)
        if f < min_l:
            min_l = f
        if jl == limit2 or il == jl or il > jl:
            break


    
    print(min_l)


main()

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(a, b):
    al = len(str(a))
    bl = len(str(b))
    if al > bl:
        return al
    return bl
N = int(input())
n = int(N**0.5)
result = len(str(N))
for a in range(1, n):
    if N % a != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)


Failing test case input:
4625887173

Expected output:
6


Actual output:
8


Fixed submission (verdict: Accepted):
def f(a, b):
    al = len(str(int(a)))
    bl = len(str(int(b)))
    if al > bl:
        return al
    return bl
N = int(input())
result = len(str(N))
for a in range(1, N):
    if a*a > N:
        break
    if (N % a) != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

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

Failing test case input:
10000

Expected output:
3

Actual output:
4


Fixed submission (verdict: Accepted):
import math

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

N = int(input())
min = F(1,N)
rt = int(math.sqrt(N))
for i in range(2,rt+1):
    if N % i != 0:
        continue
    f = F(i,int(N/i))
    if f < min:
        min = f
print(min)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

ab = []
ans = [1]
for i in range(1, int(n**(0.5))):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			
print(min(ans))


Failing test case input:
4625312013

Expected output:
5


Actual output:
1


Fixed submission (verdict: Accepted):
n = int(input())

ab = []
ans = []
for i in range(1, int(n**(0.5))+1):
	ab.clear()
	if n%i == 0:
		ab.append(i)
		ab.append(int(n/i))
		ans.append(len(str(max(ab))))
			
if len(ans) == 0:
	ans.append(1)

print(min(ans))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
from math import sqrt, ceil

def check(n):
    minf = len(str(n))
    square = ceil(sqrt(n)) 
    print(square)
    for a in range(1, square+1):
        b, r = divmod(n, a)
        if r == 0:
            f = max(len(str(a)), len(str(b)))
            minf = min(f, minf)
    return minf


N = int(input())
print(check(N))


Failing test case input:
1538

Expected output:
3


Actual output:
40
3


Fixed submission (verdict: Accepted):
from math import sqrt, ceil

def check(n):
    minf = len(str(n))
    square = ceil(sqrt(n)) 
    for a in range(1, square+1):
        b, r = divmod(n, a)
        if r == 0:
            f = max(len(str(a)), len(str(b)))
            minf = min(f, minf)
    return minf


N = int(input())
print(check(N))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

if __name__ == '__main__':
    N = int(input())
    root_N_int = math.floor(math.sqrt(N))
    for A in range(root_N_int, 0, -1):
        if N % A == 0:
            B = int(N / A)
            print(B)
            break
    digit = len(str(B))
    print(digit)

Failing test case input:
1416341852

Expected output:
8


Actual output:
18636077
8


Fixed submission (verdict: Accepted):
import math

if __name__ == '__main__':
    N = int(input())
    root_N_int = math.floor(math.sqrt(N))
    for A in range(root_N_int, 0, -1):
        if N % A == 0:
            B = int(N / A)
            break
    digit = len(str(B))
    print(digit)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n=int(input())
x=math.floor(n)

while 1:
  if n % x ==0:
    break
  x-=1

print(max(len(str(int(n/x))),len(str(x))))

Failing test case input:
10000

Expected output:
3

Actual output:
5


Fixed submission (verdict: Accepted):
import math
n=int(input())
x=math.floor(n**0.5)

while 1:
  if n % x ==0:
    break
  x-=1

print(max(len(str(int(n/x))),len(str(x))))
Problem: p03775
Buggy submission (Python (3.8.2), verdict: Wrong Answer):

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

Failing test case input:
10605

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):

import math
N=int(input())

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


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

print(min(ans))

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

n = int(input())


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


n_table = prime_decomposition(n)
f = 9999

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

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

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

print(f)

Failing test case input:
1538

Expected output:
3


Actual output:
4


Fixed submission (verdict: Accepted):
import itertools

n = int(input())


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


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


for i in range(len(n_table) + 1):

    i_a = itertools.combinations(n_table, i)

    while True:
        try:
            a = 1
            for j in next(i_a):

                a *= j
            b = int(n / a)

            _f = (len(str(max(a, b))))
        except StopIteration:
            break

        if _f < f:
            f = _f

print(f)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
n = int(input())

a = 1
b = 1




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

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

b = int(n / a)

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

print(f, a, b)



Failing test case input:
4606

Expected output:
2


Actual output:
2 49 94


Fixed submission (verdict: Accepted):
import math
n = int(input())

a = 1
b = 1




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

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

b = int(n / a)

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

print(f)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())

min_len = len(str(n))
for i in range(2,int(n**(1/2))+1):
    if n%i==0:
        l = max(len(str(i)), len(str(n/i)))
        min_len = min(min_len, l)

print(min_len)

Failing test case input:
2771679283

Expected output:
9


Actual output:
10


Fixed submission (verdict: Accepted):
n = int(input())

min_len = len(str(n))
for i in range(2,int(n**(1/2))+1):
    if n%i==0:
        l = max(len(str(i)), len(str(n
        min_len = min(min_len, l)


print(min_len)
Problem: p03775
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)))
        
        if a > b and a < ans:
            ans = a
        elif a < b and b < ans:
            ans = b


print(ans)

Failing test case input:
984724511

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
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)))
        
        if a > b and a < ans:
            ans = a
        elif a < b and b < ans:
            ans = b
        elif a == b and a < ans:
            ans = a


print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(a, b):
    al = len(str(a))
    bl = len(str(b))
    if al > bl:
        return al
    return bl
N = int(input())
n = int(N**0.5)
result = len(str(N))
for a in range(1, n):
    if n % a != 0:
        continue
    b = n / a
    r = f(a, b)
    if r < result:
        result = r
print (result)


Failing test case input:
619233107

Expected output:
7


Actual output:
4


Fixed submission (verdict: Accepted):
def f(a, b):
    al = len(str(int(a)))
    bl = len(str(int(b)))
    if al > bl:
        return al
    return bl
N = int(input())
result = len(str(N))
for a in range(1, N):
    if a*a > N:
        break
    if (N % a) != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
n = int(input())
import math
r = math.sqrt(n)
l1 = []
l2 = []
for i in range(1, int(r+1)):
    if n % i == 0:
        a = i
        b = n / i
        if a <= b:
            l1.append([str(a), str(int(b))])
print(l1)

for j in l1:
    u = j[0]
    v = j[1]
    if len(u) >= len(v):
        f = len(u)
    else:
        f = len(v)
    l2.append(f)

print(min(l2))


Failing test case input:
102392

Expected output:
5


Actual output:
[['1', '102392'], ['2', '51196'], ['4', '25598'], ['8', '12799']]
5


Fixed submission (verdict: Accepted):
n = int(input())
import math
r = math.sqrt(n)
l1 = []
l2 = []
for i in range(1, int(r+1)):
    if n % i == 0:
        a = i
        b = n / i
        if a <= b:
            l1.append([str(a), str(int(b))])

for j in l1:
    u = j[0]
    v = j[1]
    if len(u) >= len(v):
        f = len(u)
    else:
        f = len(v)
    l2.append(f)

print(min(l2))
Problem: p03775
Buggy submission (Python (3.8.2), verdict: Wrong Answer):
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)))
        
        if a > b and a < ans:
            ans = a
        elif a < b and b < ans:
            ans = b


print(ans)

Failing test case input:
3194941194

Expected output:
5


Actual output:
6


Fixed submission (verdict: Accepted):
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)))
        
        if a > b and a < ans:
            ans = a
        elif a < b and b < ans:
            ans = b
        elif a == b and a < ans:
            ans = a


print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())
ans = 10

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

print(ans)

Failing test case input:
953

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
import math
N = int(input())
ans = 10

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

print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())

max_A = math.floor(N**0.5)

ans = len(str(N))

for A in range(1, max_A):
  if N % A == 0:
    B = int(N / A)
    if len(str(B)) > len(str(A)) and len(str(B)) < ans:
      ans = len(str(B))
      
    elif len(str(A)) > len(str(B)) and len(str(A)) < ans:
      ans = len(str(A))
      

print(ans)

Failing test case input:
4606

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):
import math

N = int(input())

max_A = math.floor(N**0.5)

ans = len(str(N))

for A in range(1, max_A+1):
  if N % A == 0:
    B = int(N / A)
    if len(str(B)) >= len(str(A)) and len(str(B)) < ans:
      ans = len(str(B))
      
    elif len(str(A)) > len(str(B)) and len(str(A)) < ans:
      ans = len(str(A))
      

print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

N = int(input())
n = int(math.sqrt(N))
if N / n == n:
    print(int(math.log10(n) + 1))
else:
    while N % n != 0:
        n -= 1
    print(int(math.log10(n) + 1))


Failing test case input:
10211397040

Expected output:
6


Actual output:
5


Fixed submission (verdict: Accepted):
import math

N = int(input())
n = int(math.sqrt(N)) + 1
if N / n == n:
    print(int(math.log10(n) + 1))
else:
    while N % n != 0:
        n -= 1
    print(int(math.log10(N/n) + 1))
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

if n % a == 0.0:
    b = math.log10(a) + 1
    print(b)
else:
    a = int(a)
    while n % a != 0.0:
        a = a -1
    b = math.log10(a) + 1
    print(b)
        

Failing test case input:
984724511

Expected output:
5


Actual output:
5.260286095909859


Fixed submission (verdict: Accepted):
import math


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

if n % a == 0.0:
    b = int(math.log10(a)) + 1
    print(b)
else:
    a = int(a)
    for i in range(a, 0, -1):
    	if n % i == 0:
    		a = n / i
    		break
    b = int(math.log10(a)) + 1
    print(b)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N = int(input())

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

def digit(x):
    if 100<= x <1000:
        return 3
    elif 1000 <= x < 10000:
        return 4
    elif 10000 <= x < 100000:
        return 5
    elif 100000 <= x < 1000000:
        return 6
    elif 10**6 <= x < 10**7:
        return 7
    elif 10**7 <= x < 10**8:
        return 8
    elif 10**8 <= x < 10**9:
        return 9
    else:
        return 10

while True:
    if(N % n == 0):
        k = N / n
        print(digit(k))
        break
    n-=1


Failing test case input:
470

Expected output:
2


Actual output:
10


Fixed submission (verdict: Accepted):
import math
N = int(input())

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

def digit(x):
    if 1 <= x < 10:
        return 1
    elif x < 100:
        return 2
    elif x < 1000:
        return 3
    elif x < 10000:
        return 4
    elif x < 100000:
        return 5
    elif x < 1000000:
        return 6
    elif x < 10000000:
        return 7
    elif x < 100000000:
        return 8
    elif x < 1000000000:
        return 9
    else:
        return 10

while True:
    if(N % n == 0):
        k = N / n
        print(digit(k))
        break
    n-=1

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
def f(a, b):
    al = len(str(a))
    bl = len(str(b))
    if al > bl:
        return al
    return bl
N = int(input())
result = len(str(N))
for a in range(1, N+1):
    if a*a > N:
        break
    if (N % a) != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)

Failing test case input:
10605

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
def f(a, b):
    al = len(str(int(a)))
    bl = len(str(int(b)))
    if al > bl:
        return al
    return bl
N = int(input())
result = len(str(N))
for a in range(1, N):
    if a*a > N:
        break
    if (N % a) != 0:
        continue
    b = N / a
    r = f(a, b)
    if r < result:
        result = r
print (result)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N=int(input())
ans=10**5
for i in range(1, int(math.sqrt(N))+1):
    if int(N/i) != N/i:
        continue
    else:
        j = int(N/i)
        ans = min(ans, len(str(i)), len(str(j)))
print(ans)

Failing test case input:
3784

Expected output:
2


Actual output:
1


Fixed submission (verdict: Accepted):
import math
N=int(input())
ans=10**5
for i in range(1, int(math.sqrt(N))+1):
    if int(N/i) != N/i:
        continue
    else:
        j = int(N/i)
        ans = min(ans, max(len(str(i)), len(str(j))))
print(ans)

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

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

Failing test case input:
305762

Expected output:
3


Actual output:
5


Fixed submission (verdict: Accepted):
import math

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

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

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import itertools

n = int(input())


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


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

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

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

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

    if _f < f:
        f = _f

print(f)


Failing test case input:
18677078008

Expected output:
6


Actual output:
7


Fixed submission (verdict: Accepted):
import itertools

n = int(input())


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


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


for i in range(len(n_table) + 1):

    i_a = itertools.combinations(n_table, i)

    while True:
        try:
            a = 1
            for j in next(i_a):

                a *= j
            b = int(n / a)

            _f = (len(str(max(a, b))))
        except StopIteration:
            break

        if _f < f:
            f = _f

print(f)
Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math

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

if n % a == 0.0:
    b = int(math.log10(a)) + 1
    print(b)
else:
    a = int(a)
    while n % a != 0.0:
        a = a -1
    b = int(math.log10(a)) + 1
    print(b)

Failing test case input:
10010

Expected output:
3


Actual output:
2


Fixed submission (verdict: Accepted):
import math


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

if n % a == 0.0:
    b = int(math.log10(a)) + 1
    print(b)
else:
    a = int(a)
    for i in range(a, 0, -1):
    	if n % i == 0:
    		a = n / i
    		break
    b = int(math.log10(a)) + 1
    print(b)