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





N = int(input())
result = len(str(N))

for i in range(1,int(pow(N,0.5))):
    if(N % i == 0):
        s = max(len(str(i)), len(str(N/i)))
        result = min(s,result)
print(result)




Failing test case input:
427

Expected output:
2


Actual output:
3


Fixed submission (verdict: Accepted):





N = int(input())
result = len(str(N))

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

Problem: p03775
Buggy submission (Python (3.4.3), verdict: Wrong Answer):
import math
N=int(input())
nmax = math.floor(math.sqrt(N))
Bdigimax = 1
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.log10(N/i)
		if Bdigimax < Bdigi:
			Bdigimax = Bdigi
print(int(Bdigimax))


Failing test case input:
20640787921

Expected output:
7


Actual output:
10


Fixed submission (verdict: Accepted):
import math
N=int(input())
nmax = math.ceil(math.sqrt(N))
i = 1
Bdigimin = 10
while ( i <= nmax):
	if N % i == 0:
		Bdigi = math.floor(math.log10(N/i))
		if Bdigimin > Bdigi:
			Bdigimin = Bdigi
	i += 1
print(int(Bdigimin+1))

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 = n 
    _f = (len(str(max(a, b))))
    if f > _f:
        f = _f

print(f)


Failing test case input:
1108

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):
from math import sqrt
n = int(input())
digit = 10
for a in range(int(sqrt(n)), 0, -1):
    b = n / a
    if digit > len(str(b)) and b == int(b):
        digit = len(str(int(b)))
print(digit)

Failing test case input:
1416341852

Expected output:
8


Actual output:
10


Fixed submission (verdict: Accepted):
from math import sqrt
n = int(input())
digit = 10
for a in range(int(sqrt(n)), 0, -1):
    b = n / a
    if b == int(b):
        if digit > len(str(int(b))):
            digit = len(str(int(b)))
print(digit)