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:
n = int(input())

s = n**0.5 + 20
s = int(s)

while True:
    if n%s == 0:
        a = list(str(s))
        b = list(str(n//s))
        ans = min(len(a), len(b))
        print(ans)
        exit()
    else:
        s -= 1

Submission status: Wrong Answer

Solution code:
N = int(input())

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

ans = float('inf')
n_iter = int(N**(1/2))
for i in range(1, n_iter):
    if N%i==0:
        ans = min( ans, F(i, N//i) )

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())

x = 10**10
for i in range(1, int(n**0.5)):
    if n % i == 0:
        x = min(x, max(len(str(i)), len(str(n//i))))

print(x)

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)

    return divisors

li = make_divisors(n)
ans = 10**10

for i in range(len(li) // 2):
    a = li[i*2]
    b = li[i*2+1]
    ans = min(ans, max(len(str(a)), len(str(b))))

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())


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, cnt])

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

    if arr == []:
        arr.append([n, 1])

    return arr


fact = factorization(n)

ans = 0
a = b = 1
for x, cnt in fact[::-1]:
    for _ in range(cnt):
        if a > b:
            a, b = b, a
        a *= x

print(max(map(lambda x: len(str(x)), (a, b))))

Submission status: Wrong Answer

Solution code:
N = int(input())

ans = 100
i = 1
while i*i < N:
  if N % i == 0:
    f = len(str(max(i, N//i)))
    ans = min(f, ans)
  i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

def digit(x):
  for n in range(13):
    if x // (10**n) == 0:
      return n

ans = 100
i = 1
while i*i < N:
  if N % i == 0:
    f = digit(max(i, N//i))
    ans = min(f, ans)
    #print(i, N//i, f)
  i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""
# O(root:N)
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, cnt])

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

    if arr==[]:
        arr.append([n, 1])

    return arr

import math
N=int(input())
# rootを求める
# 二分探索すればいいのか！！！
ans = 0
pairs = factorization(N)
keta = lambda x: len(str(x))
for a,b in pairs:
  ans = max(keta(a), keta(b))

print(ans)

# root_n = int(math.sqrt(N))
# up_n = root_n
# up_ans = 0

# while up_n <= N:
#   if N % up_n == 0:
#     pair = int(N/up_n)
#     # 桁数を求める
    
#     break
#   else:
#     up_n+=1

# print(up_ans)

Submission status: Wrong Answer

Solution code:
def prime_pair(n):
    pairs = {}
    tmp = n
    for i in range(2, n):
        if i * i > n:
            break
        if tmp % i != 0:
            continue
        ex = 0
        while tmp % i == 0:
            ex += 1
            tmp /= i
        pairs[i] = ex
    if tmp != 1:
        pairs[int(tmp)] = 1
    return pairs

N = int(input())

ppn = prime_pair(N)
a = 1
b = 1
for k in reversed(list(ppn.keys())):
    for cnt in range(ppn[k]):
        if a < b:
            a *= k
        else:
            b *= k
            
tmp = max(a,b)
cnt = 1
while tmp//(10 ** cnt) >0:
    cnt += 1
print(cnt)

Submission status: Wrong Answer

Solution code:
def longer_length(x, y):
    len_x, len_y = len(str(x)), len(str(y))
    if len_x > len_y:
        return len_x
    return len_y


def main():
    N = int(input())
    min_odd = longer_length(N, 1)
    for n in range(2, int(N ** 0.5)):
        if N % n == 0:
            i = longer_length(n, N // n)
            if i < min_odd:
                min_odd = i
    print(min_odd)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

for i in range(1,10**5):
  if n%i==0:
    a=i
    b=n//a
    f=max(len(str(a)),len(str(b)))
    li.append(f)
print(li)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

div = len(list(str(n)))

for v in range(1,sqrt_n):
    if n%v == 0:
        b = int(n / v)
        a_div = len(list(str(v)))
        b_div = len(list(str(b)))
    
        if a_div < b_div:
            if div >= b_div:
                div = b_div
        else:
            if div >= a_div:
                div = a_div
print(div)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
sqrt_n = int(-(-math.sqrt(n)//1))

div = len(list(str(n)))

for v in range(1,sqrt_n):
    if n%v == 0:
        b = int(n / v)
        a_div = len(list(str(v)))
        b_div = len(list(str(b)))
    
        if a_div < b_div:
            if div >= b_div:
                div = b_div
        else:
            if div >= a_div:
                div = a_div
print(div)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
sqrt_n = int(-(-math.sqrt(n)//1))

div = len(list(str(n)))

for v in range(1,sqrt_n):
    if n%v == 0:
        b = int(n / v)
        a_div = len(list(str(v)))
        b_div = len(list(str(b)))
    
        if a_div < b_div:
            if div > b_div:
                div = b_div
        else:
            if div > a_div:
                div = a_div
print(div)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
sqrt_n = int(-(-math.sqrt(n)//1))

import copy

n_ = copy.copy(n)

div = len(list(str(n_)))

for v in range(1,sqrt_n):
    b = n / v
    if ((b // 1) - b) == 0:
        b = int(b)
        v = int(v)
        a_div = len(list(str(v)))
        b_div = len(list(str(b)))
    
        if a_div < b_div:
            if div > b_div:
                div = b_div
        else:
            if div > a_div:
                div = a_div
print(div)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
sqrt_n = int(math.sqrt(n)/1)

import copy

n_ = copy.copy(n)

div = len(list(str(n_)))

for v in range(1,sqrt_n):
    b = n / v
    if ((b // 1) - b) == 0:
        b = int(b)
        v = int(v)
        a_div = len(list(str(v)))
        b_div = len(list(str(b)))
    
        if a_div < b_div:
            if div > b_div:
                div = b_div
        else:
            if div > a_div:
                div = a_div
print(div)

Submission status: Wrong Answer

Solution code:
n = int(input())
import math
sqrt_n = int(math.sqrt(n)/1)

import copy

n_ = copy.copy(n)

div = len(list(str(n_)))

for v in range(1,sqrt_n):
    b = n / v
    if ((b // 1) - b) == 0:
        b = int(b)
        a_div = len(list(str(v)))
        b_div = len(list(str(b)))
    
        if a_div < b_div:
            if div > b_div:
                div = b_div
        else:
            if div > a_div:
                div = a_div
print(div)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

f_min = sum_order(1, n)
limit = int(pow(n, 1 / 2))
for i in range(2, limit):
    if n % i == 0:
        f = sum_order(i, n // i)
        f_min = min(f_min, f)

print(f_min)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil

n = int(input())
ans = 10**10+1

for i in range(1, ceil(sqrt(n))):
    d, m = divmod(n, i)
    if m == 0:
        left = len(str(i))
        right = len(str(d))
        f = max(left, right)
        if f <= ans:
            ans = f
print(ans)

Submission status: Wrong Answer

Solution code:
from math import sqrt, ceil

n = int(input())
ans = 10**10+1

for i in range(1, ceil(sqrt(n))):
    d, m = divmod(n, i)
    if m == 0:
        left = len(str(i))
        right = len(str(d))
        f = max(left, right)
        if f <= ans:
            ans = f
        else:
            break
print(ans)

Submission status: Wrong Answer

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

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

    if arr==[]:
        arr.append([n, 1])

    return arr

n = int(input())
factors = factorization(n)

ans = 10**10 + 1
left = 1
b = False
for i in factors:
    for _ in range(i[1]):
        n //= i[0]
        left *= i[0]
        
        l_len = len(str(left))
        r_len = len(str(n))
        f = max(r_len, l_len)
        if f < ans:
            ans = f
        if l_len >= r_len:
            print(ans)
            exit()

Submission status: Wrong Answer

Solution code:
f = lambda x, y: len(str(max(x, y)))

if __name__ == '__main__':
    n = int(input())
    a = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            a.append((i, n // i))
            if i != n // i:
                a.append((n//i, n // (n // i)))
    k = [f(e[0], e[1]) for e in a]
    print(max(set(k)))

Submission status: Wrong Answer

Solution code:
def f(a, b):
    digit_a = digit_b = 0

    while a:
        digit_a += 1
        a //= 10

    while b:
        digit_b += 1
        b //= 10

    return max(digit_a, digit_b)


n = int(input())

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

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

min = 10

for n in range(1,int(N**(1/2))+1):
  if min > max(len("{}".format(n)),len("{}".format(N/n))) and N%n == 0:
  	min = max(len("{}".format(n)),len("{}".format(int(N/n))))
    
print(min)

Submission status: Wrong Answer

Solution code:
import math
N = int(input())
div_list = []
while N % 2 == 0:
    div_list.append(2)
    N /= 2
div = int(math.sqrt(N))
div += (div + 1) % 2
while div <= N:
    q, m = divmod(N, div)
    if N % div == 0:
        div_list += [int(q), div]
        break
    div += 2
if len(div_list) % 2 == 1:
    div_list.insert(0, 1)
# print(div_list)
A, B = 1, 1
for i in range(0, len(div_list), 2):
    A *= div_list[i]
    B *= div_list[i + 1]
print(len(str(A)) if A > B else len(str(B)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

import math

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

ans = 100
for A in range(1,int(math.sqrt(N+1))):
    if N % A == 0:
        B = N // A
        ans = min(ans,f(A,B))
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)
            divisors.append(n//i)
    return divisors

N = int(input())
divisors = make_divisors(N)
ans = 11
for i in range(0, len(divisors), 2):
    a, b = divisors[i], divisors[i+1]
    m, n = 0, 0
    for x in range(1, 11):
        if a < 10 ** x:
            m = x
            break
    for x in range(1, 11):
        if b < 10 ** x:
            n = x
            break
    ans = min(ans, max(m, n))
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())
m = len(str(n))

for a in range(1,int(math.sqrt(n))):
    if (n // a) * a == n:
        if m > len(str(max(a,(n//a)))): 
            m = len(str(max(a,(n//a))))
            
print(m)

Submission status: Wrong Answer

Solution code:
N = int(input())
ret = float("inf")
for A in range(1,N//2):
  if N % A == 0:
    ret = min(ret,max(len(str(A)),len(str(N//A))))
print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = 1
ans = n
while a * a < n:
    if n%a == 0:
        b = n//a
        ans = min(ans, b)
    a += 1
print(len(str(ans)))

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

max_A = math.floor(N**0.5)
#print(max_A)
ans = len(str(N))
#print("initial answer : ", ans)
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))
      #print(A,B,ans)
    elif len(str(A)) > len(str(B)) and len(str(A)) < ans:
      ans = len(str(A))
      #print(A,B,ans)

print(ans)

Submission status: Wrong Answer

Solution code:
import math

N = int(input())

max_A = math.floor(N**0.5)
#print(max_A)
ans = len(str(N))
#print("initial answer : ", ans)
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))
      #print(A,B,ans)
    elif len(str(A)) > len(str(B)) and len(str(A)) < ans:
      ans = len(str(A))
      #print(A,B,ans)

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

max_A = N

ans = len(str(N))
#print("initial answer : ", ans)
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))
      #print(A,B,ans)
    elif len(str(A)) > len(str(B)) and len(str(A)) < ans:
      ans = len(str(A))
      #print(A,B,ans)

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

F = 1
F_min = 10**10

for A in range(1,int((N+1)**(1/2))):
  if N%A ==0:
    F = max(len(str(A)),len(str(int(N/A))))
    if F_min > F:
      F_min = F
            
print(F_min)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)

from collections import defaultdict
d = defaultdict(list)

import operator
from functools import reduce


def prod(iterable):
    return reduce(operator.mul, iterable, 1)


# from itertools import combinations
# comb = combinations(range(N), 2)

# 累積和
# from itertools import accumulate
# _list = list(accumulate(a_list)

# from functools import lru_cache
# @lru_cache(maxsize=None)
# def setUp(self):
#     dp.cache_clear()


def dividers(n: int):
    for i in range(1, math.ceil(math.sqrt(n))):
        if n % i == 0:
            yield i


def prime_factor(n: int):
    res = defaultdict(int)
    res[1] = 1
    for i in range(2, math.ceil(math.sqrt(n))):
        while (n % i == 0):
            res[i] += 1
            n = n // i

    if (n != 1):
        res[n] = 1

    return res


def flatten_key_count(d):
    return sum([[k for _ in range(d[k])] for k in d.keys()], [])


def resolve():
    # S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    # N, D = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

    if N == 1:
        print(1)
        return

    _min = 10**10
    for a in dividers(N):
        b = N // a

        if a > b:
            _min = min(_min, len(str(a)))
        else:
            _min = min(_min, len(str(b)))

    print(_min)


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """10000"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1000003"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """9876543210"""
        output = """6"""
        self.assertIO(input, output)

Submission status: Wrong Answer

Solution code:
import sys
sys.setrecursionlimit(4100000)

import math

import logging

logging.basicConfig(level=logging.DEBUG)

logger = logging.getLogger(__name__)

from collections import defaultdict
d = defaultdict(list)

import operator
from functools import reduce


def prod(iterable):
    return reduce(operator.mul, iterable, 1)


# from itertools import combinations
# comb = combinations(range(N), 2)

# 累積和
# from itertools import accumulate
# _list = list(accumulate(a_list)

# from functools import lru_cache
# @lru_cache(maxsize=None)
# def setUp(self):
#     dp.cache_clear()


def prime_factor(n: int):
    res = defaultdict(int)
    res[1] = 1
    for i in range(2, math.ceil(math.sqrt(n))):
        while (n % i == 0):
            res[i] += 1
            n = n // i

    if (n != 1):
        res[n] = 1

    return res


def flatten_key_count(d):
    return sum([[k for _ in range(d[k])] for k in d.keys()], [])


def resolve():
    # S = [x for x in sys.stdin.readline().split()][0]  # 文字列 一つ
    N = [int(x) for x in sys.stdin.readline().split()][0]  # int 一つ
    # N, D = [int(x) for x in sys.stdin.readline().split()]  # 複数int
    # h_list = [int(x) for x in sys.stdin.readline().split()]  # 複数int

    # grid = [list(sys.stdin.readline().split()[0]) for _ in range(N)]  # 文字列grid
    # v_list = [int(sys.stdin.readline().split()[0]) for _ in range(N)]
    # grid = [[int(x) for x in sys.stdin.readline().split()]
    #         for _ in range(N)]  # int grid

    logger.debug('{}'.format([]))

    factor_list = flatten_key_count(prime_factor(N))

    _min = 10**10
    for i in range(1, len(factor_list)):
        a = prod(factor_list[:i])
        b = prod(factor_list[i:])

        if a > b:
            _min = min(_min, len(str(a)))
        else:
            _min = min(_min, len(str(b)))

    print(_min)


if __name__ == "__main__":
    resolve()

# AtCoder Unit Test で自動生成できる, 最後のunittest.main は消す
# python -m unittest template/template.py で実行できる
# pypy3 -m unittest template/template.py で実行できる

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """10000"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """1000003"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """9876543210"""
        output = """6"""
        self.assertIO(input, output)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

def f(a,b):
    return len(str(a)) if len(str(a)) > len(str(b)) else len(str(b))

min = 10

for i in range(1,int(math.sqrt(n))):
    if n%i==0 and min > f(i,n//i):
        min = f(i,n//i)

if len(str(n))<10:
    min=1

print(min)

Submission status: Wrong Answer

Solution code:
import sys

import numpy as np
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
from collections import deque, defaultdict, Counter
from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
INF = float("INF")
mod = 10 ** 9 + 7
"""dd = [(-1, 0), (0, 1), (1, 0), (0, -1)];
ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)];
ddn9 = ddn + [(0, 0)]
for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""

def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]  # WideIntPoint
def ws(): return sys.stdin.readline().split()
def si(): return int(sys.stdin.readline())  # SingleInt
def ss(): return input()
def hi(n): return [si() for _ in range(n)]
def hs(n): return [ss() for _ in range(n)]  # HeightString
def s_list(): return list(input())
def mi(n): return [wi() for _ in range(n)]  # MatrixInt
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]  # NumberGrid
def grid(n): return [s_list() for _ in range(n)]


def main():
    n = int(input())
    root_n = np.sqrt(n)
    root_n = int(root_n)
    ans = 10**10
    for i in range(1,root_n):
        if n % i == 0:
            b = n // i
            str_b = str(b)
            ans = min(ans, len(str_b))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# https://atcoder.jp/contests/abc057/tasks/abc057_c
# なるべく√Nに近い約数を2つ探し、それにF(A,B)を適応すればよい


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

# https://atcoder.jp/contests/abc057/tasks/abc057_c
# なるべく√Nに近い約数を2つ探し、それにF(A,B)を適応すればよい


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


N = int(input())
from math import sqrt

ans = 11
for i in range(1, int(sqrt(N)) + 1):
    if N % i == 0:
        ans = min(ans, F(N // i, i))
print(ans)

from math import sqrt

ans = 11
for i in range(1, int(sqrt(N)) + 1):
    if N % i == 0:
        ans = min(ans, F(N // i, i))
print(ans)

Submission status: Wrong Answer

Solution code:
import math

n = int(input())

def f(a, b):
    c = len(str(a))
    d = len(str(b))
    return c if c > d else d

ans = n
lim = math.floor(math.sqrt(n))

for i in range(1, lim):
    if n % i == 0:
        temp = f(i, n // i)
        if temp < ans:
            ans = temp
    
print(ans)

Submission status: Wrong Answer

Solution code:
def is_prime(number):
    if number < 2:
        return False
    elif number == 2:
        return True

    if number % 2 == 0:
        return False

    i = 3
    while i <= number / i:
        if number % i == 0:
            return False
        i += 2
    return True


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

    if is_prime(N):
        return len(str(N))
    else:
        return len(str(N)) // 2 + 1


if __name__ == '__main__':
    res = solve()
    print(res)

Submission status: Wrong Answer

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


def solve(N: int):
    result = len(str(N))
    for A in range(1, int(N ** 0.5)):

        if N % A == 0:
            B = N // A
            f_value = max(len(str(A)), len(str(B)))
            result = min(result, f_value)

    print(result)
    return


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

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math


def check(A,B):
    digit_list=[]
    for num in [A,B]:
        count=0
        tmp_num=num
        while tmp_num != 0:
            tmp_num //= 10
            count += 1
        
        digit_list += [count]
    
    return max(digit_list)

#----------
N = int(input().strip())
#----------
min_f=10
for i in range( 1, math.ceil( N**(1/2) ) ):
    if (N % i) == 0:
        A,B = i,(N / i)
        digit = check(A,B)
        
        if min_f > digit:
            min_f = digit

print(min_f)

Submission status: Wrong Answer

Solution code:
n = int(input())

def myfunc(a, b):
    if len(str(a)) > len(str(b)):
        return len(str(a))
    return len(str(b))

ans = len(str(n))
i = 1
sqrt_n = n ** 0.5
while i < sqrt_n:
    if n % i == 0:
        ans = min(ans, myfunc(i, n // i))
    i += 1

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

prime_factors = []

def is_prime(n):
    sqrt_n = n ** 0.5
    if n == 0 or n == 1:
        return False
    if n == 2:
        return True
    i = 2
    while i < sqrt_n:
        if n % i == 0:
            return False
        i += 1
    return True


prime_factors = []
original = n
if is_prime(n):
    prime_factors.append(n)
else:
    i = 2
    while n > 1 and i <= original:
        if n % i == 0:
            prime_factors.append(i)
            n //= i
        else:
            i += 1

def myfunc(a, b):
    if len(str(a)) > len(str(b)):
        return len(str(a))
    return len(str(b))

nums = []
t = 1
MIN = len(str(original))
for p in prime_factors:
    original //= p
    nums.append((original, p * t))
    MIN = min(MIN, myfunc(original, p * t))
    t *= p
print(MIN)

Submission status: Wrong Answer

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

def main():
	n=int(input())
	if n==1 or n==2:
		print(1)
		exit()
	list=prime_factorize(n)
	list.sort(reverse=True) 
	x=1
	y=1
	for i in range(len(list)):
		if x<=y:
			x*=list[i]
		else:
			y*=list[i]
	z=max(len(str(x)),len(str(y)))
	print(z)

if __name__=='__main__':
	main()

Submission status: Wrong Answer

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

def main():
	n=int(input())
	if n==1 or n==2:
		print(1)
		exit()
	list=prime_factorize(n)
	list.sort(reverse=True) 
	x=1
	y=1
	for i in range(len(list)):
		if x<=y:
			x*=list[i]
		else:
			y*=list[i]
	z=max(len(str(x)),len(str(y)))
	print(z)
	print(list)
	
if __name__=='__main__':
	main()

Submission status: Wrong Answer

Solution code:
import sys

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, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

def main():
	n=int(input())
	if n==1 or n==2:
		print(1)
		sys.exit()
	list=factorization(n)
	list.sort(reverse=True) 
	x=1
	y=1
	for i in range(len(list)):
		for j in range(list[i][1]):
			if x<=y:
				x*=list[i][0]
			else:
				y*=list[i][0]
	z=max(len(str(x)),len(str(y)))
	print(z)

if __name__=='__main__':
	main()