Problem:


Score : 300 points

Problem Statement

You are given an integer N.

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

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

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

Constraints

1 \leq N \leq 10^{10}

N is an integer.

Input

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

N

Output

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

Sample Input 1

10000

Sample Output 1

3

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

Sample Input 2

1000003

Sample Output 2

7

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

Sample Input 3

9876543210

Sample Output 3

6



Sample input:
10000


Sample output:
3

Submission status: Wrong Answer

Solution code:
import math

N=int(input())

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

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

Submission status: Wrong Answer

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)


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(read())
print(max(map(lambda x: len(str(x)), make_divisors(n)[-2:])))

Submission status: Wrong Answer

Solution code:
N = int(input().strip())

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

f = N
for i in range(1, N):
    if i * i >= N:
        break
    if N % i == 0:
        _f = F(i, N // i)
        f = min(f, _f)

print(f)

Submission status: Wrong Answer

Solution code:
N = int(input().strip())

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

f = N
for i in range(1, N):
    if i * i >= N:
        break
    if N % i == 0:
        _f = F(i, N // i)
        f = min(f, _f)

Submission status: Wrong Answer

Solution code:
N = int(input())

def divisor(n):
    i = 1
    table = []
    while i * i <= n :
        if n%i == 0:
            table.append(i)
            table.append(n//i)
        i += 1
    table = list(set(table))
    return table


yakusu = divisor(N)

yakusu_str = list(map(len,list(map(str, yakusu))))
yakusu_len = list(set(yakusu_str))

N_len = len(str(N))

nokori_list = [N_len - i + 1 for i in yakusu_len ]

ans = N_len
for i in range(len(yakusu_len)):
    kekka = max(yakusu_len[i],nokori_list[i])
    if ans > kekka:
        ans = kekka

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

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

Submission status: Wrong Answer

Solution code:

DEBUG = False
N = int(input())

# if N == 1:
#     print(1)
#     exit()

divisors = []

tmp = N
for i in range(2, int(N**0.5)+2):
    while tmp % i == 0:
        tmp //= i
        divisors.append(i)
if tmp != 1:
    divisors.append(tmp)

if DEBUG:
    print(divisors)

A = 1
B = 1
while divisors:
    x = divisors.pop()
    if A > B:
        B *= x
    else:
        A *= x

if DEBUG:
    print("A: {}, B: {}".format(A, B))

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

Submission status: Wrong Answer

Solution code:

DEBUG = False
N = int(input())

# if N == 1:
#     print(1)
#     exit()

divisors = []

tmp = N
for i in range(2, int(N**0.5)+1):
    while tmp % i == 0:
        tmp //= i
        divisors.append(i)
if tmp != 1:
    divisors.append(tmp)

if DEBUG:
    print(divisors)

A = 1
B = 1
while divisors:
    x = divisors.pop()
    if A > B:
        B *= x
    else:
        A *= x

if DEBUG:
    print("A: {}, B: {}".format(A, B))

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

Submission status: Wrong Answer

Solution code:

DEBUG = True
N = int(input())

# if N == 1:
#     print(1)
#     exit()

divisors = []

tmp = N
for i in range(2, int(N**0.5)+1):
    while tmp % i == 0:
        tmp //= i
        divisors.append(i)
if tmp != 1:
    divisors.append(tmp)

if DEBUG:
    print(divisors)

A = 1
B = 1
while divisors:
    x = divisors.pop()
    if A > B:
        B *= x
    else:
        A *= x

if DEBUG:
    print("A: {}, B: {}".format(A, B))

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

divisors = []

tmp = N
for i in range(2, int(N**0.5)):
    while tmp % i == 0:
        tmp //= i
        divisors.append(i)
if tmp != 1:
    divisors.append(tmp)

# print(divisors)

A = 1
B = 1
while divisors:
    x = divisors.pop()
    if A > B:
        B *= x
    else:
        A *= x

# print("A: {}, B: {}".format(A, B))
print(max(len(str(A)), len(str(B))))

Submission status: Wrong Answer

Solution code:
N = int(input())

divisors = []

tmp = N
for i in range(2, int(N**0.5)):
    while tmp % i == 0:
        tmp //= i
        divisors.append(i)
if tmp != 1:
    divisors.append(tmp)

# print(divisors)

A = 1
B = 1
while divisors:
    x = divisors.pop()
    if A > B:
        B *= x
    else:
        A *= x

# print("A: {}, B: {}".format(A, B))
print(max(len(str(A)), len(str(B))))

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, log2
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
import numpy as np
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def f(A, B):
	return max(len(A), len(B))

N = INT()
ans = 11

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

print(ans)

Submission status: Wrong Answer

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

N = int(input())

div = make_divisors(N)
ans = len(str(N))

for i in range(0,len(div)-1,2):
  A,B = str(div[i]),str(div[i+1])
  ans = min(ans,max(len(A),len(B)))
print(ans)

Submission status: Wrong Answer

Solution code:
import math

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

N = int(input())

res = 0
long = len(str(N))

if is_prime(N) == True:
    res = long
else:
		if long % 2 == 0:
		    res = long // 2
		else:
		    res = long // 2 + 1

print(res)

Submission status: Wrong Answer

Solution code:
N = str(input())
res = 0
if len(N) % 2 == 0:
    res = len(N)//2
else:
    res = len(N)//2 + 1
print(res)

Submission status: Wrong Answer

Solution code:
import sys
import math

N = int(sys.stdin.readline().rstrip())

ans = float("inf")
d_max = int(math.sqrt(N))
for i in range(1, d_max):
    if N % i == 0:
        ans = min(ans, max(len(str(i)), len(str(N//i))))

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

ans = 10**10
for i in range(1, n//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: Wrong Answer

Solution code:
c = 12
n = int(input())
import math
m = int(math.sqrt(n)+1)
if n ==1:
    print(1)
    exit()
result = []
for a in range(1,m+1):
    counta = 0
    countb = 0
    if n%a == 0:
        b = n/a
        while a >= 1:
            a = a/10
            counta += 1
        while b >= 1:
            b = b/10
            countb += 1
        if c >= counta + countb:    
            c = counta + countb
            result.append(max([counta,countb]))
            
print(min(result))

Submission status: Wrong Answer

Solution code:
c = 12
n = int(input())
import math
m = int(math.sqrt(n)+1)

result = []
for a in range(1,m+1):
    counta = 0
    countb = 0
    if n%a == 0:
        b = n/a
        while a >= 1:
            a = a/10
            counta += 1
        while b >= 1:
            b = b/10
            countb += 1
        if c >= counta + countb:    
            c = counta + countb
            result.append(max([counta,countb]))
            
print(min(result))

Submission status: Wrong Answer

Solution code:
c = 12
n = int(input())
import math
m = int(math.sqrt(n)+1)

result = []
for a in range(1,m+1):
    counta = 0
    countb = 0
    if n%a == 0:
        b = n/a
        while a >= 1:
            a = a/10
            counta += 1
        while b >= 1:
            b = b/10
            countb += 1
        if c >= counta + countb:    
            c = counta + countb
            result.append(max([counta,countb]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input()) 
n = int(N**.5)
res = len(str(N))
print(n)
for i in range(2,n+1):
    if N % i == 0:
        #print(len(str(i)),len(str(N/i)))
        f = max(len(str(i)),len(str(N//i)))
        res = min(res, f)
#        print(i, len(str(i)),len(str(N/i)),res, f)
print(res)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
ans = float("inf")
for i in range(2, math.ceil(math.sqrt(N)+1)):
  if N % i == 0 and ans > (N // i):
    ans = N // i
print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

def cnt_digits(N):
    ctr = 0
    while N>0:
        N = int(N/10)
        ctr += 1

    return ctr

ans = cnt_digits(N)

for i in range(1, int(math.sqrt(N))):
    if N%i != 0: continue
    B = int(N/i)
    cur = max(cnt_digits(i),cnt_digits(B))

    if (ans>cur):
        ans=cur
print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

def cnt_digits(N):
    ctr = 0
    while N>0:
        N //= 10
        ctr += 1

    return ctr

ans = cnt_digits(N)

for i in range(1, int(math.sqrt(N))):
    if N%i != 0: continue
    B = N//i
    cur = max(cnt_digits(i),cnt_digits(B))

    if (ans>cur):
        ans=cur
print(ans)

Submission status: Wrong Answer

Solution code:
import math
n = int(input())
mi =11
def f(a,b):
    return max(int(math.log10(a))+1,int(math.log10(b))+1)

for i in range(1,int(math.sqrt(n))):
    if n%i==0:
        t=f(i,n//i)
        if t<mi:
            mi=t
print(mi)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    # ccc = 0
    for i in range(1, n+1):
        # ccc += 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(ccc)
    print(min_l)


main()

Submission status: Wrong Answer

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

    # ccc = 0
    for i in range(1, n+1):
        # ccc += 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(ccc)
    print(min_l)


main()

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
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(reverse = True)
    return divisors
#print(make_divisors(n))
ans = float('inf')
for i in range(len(make_divisors(n))//2):
    ans = min(ans, make_divisors(n)[i])
print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

min_length = -1
for i in range(int(math.sqrt(N))):
    for j in range(i + 1):
        A = j + 1
        if N % A == 0:
            B = int(N / A)
            len_a = len(str(A))
            len_b = len(str(B))
            length = len_a if len_a >= len_b else len_b
            if min_length == -1 or length < min_length:
                print("len:{}, A:{}, B:{}".format(length, A, B))
                min_length = length
print(min_length)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if n == 1:
    print(1)

Submission status: Wrong Answer

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

for i in reversed(range(1, n // 2)):
    if n % i == 0:
        print(max(len(str(i)), len((str(n // i)))))
        break

Submission status: Wrong Answer

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

for i in reversed(range(1, math.sqrt(n).__int__())):
    if n % i == 0:
        print(max(len(str(i)), len((str(n // i)))))
        break

Submission status: Wrong Answer

Solution code:
def resolve():
    N = int(input())
    factors = prime_factors(N)
    print(factors)
    minf = float("inf")
    
    for bits in range(1<<len(factors)):
        fac_a = 1
        for odr in range(len(factors)):
            if bits & (1<<odr):
                fac_a *= factors[odr]
                
        fac_b = N // fac_a
        l = max(len(str(fac_a)), len(str(fac_b)))
        minf = min(minf, l)
    print(minf)

def prime_factors(n):
    i = 2
    factors = []
    while i**2 <= n:
        if n % i != 0:
            i += 1
        else:
            factors.append(i)
            n = n // i
    if n > 1:
        factors.append(n)
    return factors
    



if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
n = math.ceil(math.sqrt(N))
A = 1
B = N
for i in range(n+1):
  A = n-i
  if N%A==0:
    B = N//A
    break

print(len(str(A)))

Submission status: Wrong Answer

Solution code:
N = int(input())

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

n = int(N ** (1/2))
#arr =[]
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)))
#    print(res, i, N/i)
  i += 1

print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
res = 10**10 + 1
for A in range(1, N // 2 + 1):
    if N % A == 0:
        B = N // A
        a = len(str(A))
        b = len(str(B))
        if a > b:
            num = a
        else:
            num = b
        if res > num:
            res = num
print(res)

Submission status: Wrong Answer

Solution code:
N=int(input())
div=[]
Min=100000
for i in range(1,int(N**(0.5))):
    if N%i==0:
        div+=[[i,N//i]]
for n in range(len(div)):
    if max(len(str(div[n][0])),len(str(div[n][1])))<Min:
        Min=max(len(str(div[n][0])),len(str(div[n][1])))
print(Min)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
ans = float('Inf')
sq = int(math.sqrt(n)) + 1
for i in range(1, sq):
    #print(i, n // i)
    if n % i != 0:
        continue
    print(i, n // i)
    ans = min(ans, max(len(str(i)), len(str(n // i))))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
sq = math.sqrt(n)
if isinstance(sq, int):
    print(len(str(sq)))
    quit()
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
# n == 1のとき、[1, 1]を返す
def factorization(n):
    
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            #cnt=0
            while temp%i==0:
                #cnt+=1
                temp //= i
                arr.append(i)
            #arr.append([i, cnt])

    if temp!=1:
        #arr.append([temp, 1])
        arr.append(temp)

    if arr==[]:
        #arr.append([n, 1])
        arr.append(n)
    return arr
factor = factorization(n)
if len(factor) == 1:
    print(len(str(n)))
    quit()
first = 1
ans = float('Inf')
for i in range(len(factor) - 1):
    first *= factor[i]
    second = int(n / first)
    #print(first, second)
    ans = min(ans, max(len(str(first)), len(str(second))))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
# n == 1のとき、[1, 1]を返す
def factorization(n):
    
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            #cnt=0
            while temp%i==0:
                #cnt+=1
                temp //= i
                arr.append(i)
            #arr.append([i, cnt])

    if temp!=1:
        #arr.append([temp, 1])
        arr.append(temp)

    if arr==[]:
        #arr.append([n, 1])
        arr.append(n)
    return arr
factor = factorization(n)
if len(factor) == 1:
    print(len(str(n)))
    quit()
first = 1
ans = float('Inf')
for i in range(len(factor) - 1):
    first *= factor[i]
    second = int(n / first)
    #print(first, second)
    ans = min(ans, max(len(str(first)), len(str(second))))
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
# n == 1のとき、[1, 1]を返す
def factorization(n):
    
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            #cnt=0
            while temp%i==0:
                #cnt+=1
                temp //= i
                arr.append(i)
            #arr.append([i, cnt])

    if temp!=1:
        #arr.append([temp, 1])
        arr.append(temp)

    if arr==[]:
        #arr.append([n, 1])
        arr.append(n)
    return arr
factor = factorization(n)
first = 1
ans = float('Inf')
for i in range(len(factor) - 1):
    first *= factor[i]
    second = int(n / first)
    #print(first, second)
    ans = min(ans, max(len(str(first)), len(str(second))))
print(ans)

Submission status: Wrong Answer

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

n = int(input())

divisors = make_divisors(n)

l = len(divisors)
#print(divisors)

ans = float('inf')
for i in range(l):
    a = divisors[i]
    b = int(n/a)
    m = max([a,b])
    keta = 1
    while m > 9:
        m = m/10
        keta += 1
    ans = min([ans, keta])

print(ans)

Submission status: Wrong Answer

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

divisors = make_divisors(n)

l = len(divisors)
#print(divisors)

ans = float('inf')
for i in range(l):
    a = divisors[i]
    b = int(n/a)
    m = max([a,b])
    keta = 1
    while m > 9:
        m = m/10
        keta += 1
    ans = min([ans, keta])

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

k = 0

for i in range(1,int(N**(0.5))):
    if N % i == 0:
        n = str(int(N // i))
        I = str(i)
        K = len(n) if len(n) >= len(I) else len(I)
        if k == 0:
            k = K
        else:
            if k > K:
                k = K
            else:
                continue

print(k)

Submission status: Wrong Answer

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
a = make_divisors(n)
a.sort()
c = 100
for i in a:
	if i > n//2:
		break
	j = n//i
	c = min(max(len(str(i)),len(str(j))),c)
print(c)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
# AtCoder
import math
N = int(input())
mi = float("inf")


def F(x, y):
    return max(len(str(x)), len(str(y)))


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

for A in range(1, sq):
    if N % A == 0:
        B = N // A
        mi = min(F(A, B), mi)
print(mi)

Submission status: Wrong Answer

Solution code:
# AtCoder
import math
N = int(input())
mi = float("inf")


def F(x, y):
    return max(len(str(x)), len(str(y)))


sq = math.floor(math.sqrt(N)+1)

for A in range(1, sq):
    if N % A:
        B = N // A
        mi = min(F(A, B), mi)
print(mi)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env pytHon3
# -*- coding: utf-8 -*-


def prime_decomposition(n):
    # 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


def main():
    N = int(input())
    a, b = 1, 1
    prime = prime_decomposition(N)
    prime.sort(reverse=True)

    for p in prime:
        if a > b:
            b *= p
        else:
            a *= p

    print(max(len(str(int(a))), len(str(int(b)))))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:


#桁数を返す
#Nの桁数を返す (Nが0のときは0が返る)
#10進法のときは、10で割り続ければ桁数が返る
def calc_digits(n):
    res = 0
    while( int(n) ):
        res += 1
        n /= 10
    return res

N = int(input())
ans = float('inf')

for i in range(1,N):
    #調べるのはNの1/2乗まででよい
    if i * i > N:
        break

    if ( N % i == 0):
        #Nがiで割り切れたら約数は B と i
        B = N / i
        temp = max((calc_digits(i)),calc_digits(B))
        ans = min(ans,temp)

print(ans)

Submission status: Wrong Answer

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

for i in range(int(N**0.5)+1,1,-1):
    if N%i==0:
        a=str(N//i)
        print(len(a))
        sys.exit()

Submission status: Wrong Answer

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

for i in range(int(N**0.5),1,-1):
    if N%i==0:
        a=str(N//i)
        print(len(a))
        sys.exit()

Submission status: Wrong Answer

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

def main():
    N = int(input())
    l = make_divisors(N)
    root = int(N ** 0.5 + 1)
    for i in l:
        if i >= root:
            print(len(str(i)))
            break

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

M = int(math.ceil(math.sqrt(N)))

for i in reversed(range(1, M)):
    if N % i == 0:
        print(len(list(str(N // i))))
        break

Submission status: Wrong Answer

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)

if m == 1:
    print(f(1))
    exit(0)

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: Wrong Answer

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 m == 1:
  print(f(1))
elif root_m<max(pf.keys()):
    print(f(max(pf.keys())))
else:
    print(f(root_m))

Submission status: Wrong Answer

Solution code:
import sys
import math
N = int(input())
for n in range(int(math.sqrt(N))+1,1,-1):
  if N%n==0:
    print(max(int(math.log10(n)), int(math.log10(N//n)))+1)
    sys.exit()

Submission status: Wrong Answer

Solution code:
import sys
import math
N = int(input())
for n in range(int(math.sqrt(N)),1,-1):
  if N%n==0:
    print(max(int(math.log10(n)), int(math.log10(N//n)))+1)
    sys.exit()

Submission status: Wrong Answer

Solution code:
N = int(input())

F = len(str(N))
for A in range(1, int(N**0.5)+1):
    if N%A != 0:
        continue
    B = N // A
    F = min(F, max([len(str(x)) for x in [A,B]]))
    print(F,A,B)

print(F)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
def F(A,B):
    A_len=len(str(A))
    B_len=len(str(B))
    return max(A_len,B_len)

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


N=int(input())
if(N==1):
    print(1)
    sys.exit()
MIN=len(str(N))
lis=(make_divisors(N))
for l in lis:
    A=l[0]
    B=l[1]
    MIN=min(F(A,B),MIN)

print(MIN)

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = int(1e5)

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

Submission status: Wrong Answer

Solution code:
import math

N = int(input())
N_s = math.floor(math.sqrt(N))

for i in reversed(range(1, N_s)):
    if N % i == 0:
        print(len(list(str(N // i))))
        break

Submission status: Wrong Answer

Solution code:
N = int(input())
ans = 10
for i in range(1,int(N**0.5)):
    if(N%i==0):
        a = i
        b = int(N/i)
        F = max(len(str(a)), len(str(b)))
        ans = min(ans, F)
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
ans = []
a = 0
for i in range(n+1):
    for j in range(n+1):
        if n == int(i)*int(j):
            a == i*j
            ans.append(a)
print(ans)
print(min(ans))

Submission status: Wrong Answer

Solution code:
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):
    amari = n%a
    if amari == 0:
        b = int(n / a)
        f = max(len(str(a)),len(str(b)))
        ans = min(f,ans)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
import sys 

n = int(input())

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

ans = 10**10

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

print(ans)

Submission status: Wrong Answer

Solution code:
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 = int(n / a)
        f = max(len(str(a)),len(str(b)))
        ans = min(f,ans)
        

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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