TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
N=int(input())
ans=float('inf')

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

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

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

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

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

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

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

Submission attempts (in order):
# from pprint import pprint
import math

# import collections

n = int(input())



# a = list(map(int, input().split(' ')))


def f(a, b):
    return max(math.ceil(math.log10(a)), math.ceil(math.log10(b)))


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0:
        b = n // a
        if n % a == 0 and f(a, b) <= ans:
            ans = f(a, b)
    a += 1

print(ans)


# from pprint import pprint
import math

# import collections

n = int(input())



# a = list(map(int, input().split(' ')))


def f(a, b):
    return max(math.ceil(math.log10(a)), math.ceil(math.log10(b)))


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0 and f(a, n // a) <= ans:
        ans = f(a, n // a)
    a += 1

print(ans)


# from pprint import pprint
import math

# import collections

n = int(input())



# a = list(map(int, input().split(' ')))


def f(a, b):
    return max(math.floor(math.log10(a)+1), math.floor(math.log10(b))+1)


a = 1
ans = 11
while a <= math.sqrt(n):
    if n % a == 0 and f(a, n // a) <= ans:
        ans = f(a, n // a)
    a += 1

print(ans)


Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
N = int(input())
min_num = 10**5
for i in range(1, N+1):
  if N % i == 0:
    min_num = min(max(len(i), len(N//i)), min_num)
print(min_num)

N = int(input())
min_num = 10**5
for i in range(1, 10**5+1):
    if N % i == 0:
        min_num = min(max(len(str(i)), len(str(N//i))), min_num)
print(min_num)

Verdicts: Runtime Error

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

Submission attempts (in order):
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)))


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


Verdicts: Wrong Answer

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

Submission attempts (in order):
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)

import math

N = int(input())

min_length = -1
for A in range(1, int(math.sqrt(N)) + 1, 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:
            
            min_length = length
print(min_length)


Verdicts: Wrong Answer

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

Submission attempts (in order):
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)


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//i))
      break
print(rt)


Verdicts: Wrong Answer

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

Submission attempts (in order):
# -*- coding: utf-8 -*-
import math

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

for i in range(0,tmp):
	if(n%(tmp-i)==0):
		break

#print(tmp-i)
ansn=n//(tmp-i)
#print(ansn)
ans=math.floor(math.log10(ansn-1)) + 1

print(ans)



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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))


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

for i in range(0,n):
	if(n%(tmp+i)==0):
		break

#print(tmp+i)
print(math.floor(math.log10(tmp+i-1) + 1))



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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

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

for i in range(0,tmp):
	if(n%(tmp-i)==0):
		break

#print(tmp-i)
ansn=n//(tmp-i)
#print(ansn)
ans=math.floor(math.log10(ansn-1)) + 1

print(ans)



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

n = int(input())
#tmp = input().split()
#hoge = list(map(lambda a: int(a), tmp))

tmp= math.ceil(math.sqrt(n))
#print(n)
#print(tmp)
for i in range(0,tmp):
	if(n%(tmp-i)==0):
		break

#print(tmp-i)
ansn=n//(tmp-i)
#print(ansn)
#print(math.log10(ansn))
#print(max(ansn,tmp-i))
#print(math.floor(0.9))
ans=math.floor(math.log10(max(ansn,tmp-i))) + 1

print(ans)



Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
N = int(input())
res = 10**10 + 1
for A in range(1, N + 1):
    for B in range(1, A + 1):
        total = A * B
        if total == N:
            a = len(str(A))
            b = len(str(B))
            if a > b:
                num = a
            else:
                num = b
            if res > num:
                res = num
print(res)


import math
N = int(input())
res = float('Inf')
M = int(math.sqrt(N))
for A in range(1, M+1):
    if N % A == 0:
        B = int(N / A)
        a = len(str(A))
        b = len(str(B))
        c = max(a, b)
        if res > c:
            res = c
print(res)

Verdicts: Time Limit Exceeded

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

Submission attempts (in order):
# ABC 057 C - Digits in Multiplication

n = int(input())

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

ans = math.inf
for i in range(1, int(n**(1/2))+1):
    j = n / i
    if j%1 == 0:
        j = n // i
        if ans > F(i, j):
            ans = F(i, j)
            
print(ans)

n = int(input())

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

ans = 10**10
for i in range(1, n**(1/2)+1):
    j = n / i
    if (n/i)%1 == 0:
        j = n // i
        if ans > F(i, j):
            ans = F(i, j)
        
print(ans)

n = int(input())

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

ans = 10**10
for i in range(1, int(n**(1/2))+1):
    j = n / i
    if (n/i)%1 == 0:
        j = n // i
        if ans > F(i, j):
            ans = F(i, j)
        
print(ans)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
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))
	i += 1
print(score)


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 // (10 ** (score - 1)) - 1
    else:
        i += 1
print(score)


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))
	
	i += 1
print(score)


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)


Verdicts: Runtime Error

Wrong Answer

Runtime Error

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

Submission attempts (in order):
def fdigit(a,b):
    if len(str(a)) > len(str(b)):
        return len(str(a))
    else:
        return len(str(b))

N = int(input())
result = 10000000000
goal = int((N**0.5)//1)

for i in range(1, goal):
    if N%i ==0:
        if result > fdigit(i, N//i):
            result = fdigit(i, N//i)
            print(i, N/i,fdigit(i, N//i))

print(result)

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

N = int(input())
result = 10000000000
goal = int((N**0.5)//1)

for i in range(1, goal+1):
    if N%i ==0:
        #print(i)
        if result > fdigit(i, N//i):
            result = fdigit(i, N//i)
            

print(result)

Verdicts: Wrong Answer

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

Submission attempts (in order):
import math
from sys import exit, stdin
N = int(stdin.readline().rstrip())
N = int(math.sqrt(N))

ans = 0
for i in range(N, 0, -1):
    if N % i == 0:
        ans = N // i
        break
print(len(str(ans)))

import math
from sys import exit, stdin
N = int(stdin.readline().rstrip())
ans = 0
for i in range(int(math.sqrt(N)), 0, -1):
    if N % i == 0:
        ans = N // i
        break
print(len(str(ans)))

Verdicts: Wrong Answer

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

Submission attempts (in order):
n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>=(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        for i in range(d):
            a*=d[i]
            if a>n**(1/2):
                break
        a=str(a)
        print(len(list(a)))

n=int(input())
import fractions
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table
d=list(prime_decomposition(n))
cnt=n
ans=[]
a=1
b=1
if n==1:
    print(1)
else:
    if len(list(str(d[len(d)-1])))>(len(list(str(n)))+1)//2:
        print(len(list(str(d[len(d)-1]))))
    else:
        for i in range(len(d)):
            if i%2==0:
                a*=d[i//2]
            else:
                a*=d[len(d)-i//2]
            if a>n**(1/2):
                break
        a=str(a)
        print(len(list(a)))
        #print(a)


n=int(input())
cnt=[]
for i in range(1,int(n**(1/2))+1000):
    if n%i==0:
        cnt.append(n//i)
        cnt.append(i)
#print(cnt)
ans=[]
for j in range(len(cnt)//2):
    a=list(str(cnt[2*j]))
    b=list(str(cnt[2*j+1]))
    ans.append(max(len(a),len(b)))
print(min(ans))

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
n=int(input())
ans=0
for i in range(1,int(n**0.5+1)):
    if n%i==0:ans=min(ans,len(str(n//i)))
print(ans)

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
# ABC 057 C - Digits in Multiplication

import math
N = int(input())
ans = []
# N = int(math.sqrt(N))
for i in range(1,N+1): 
    if N%i == 0: 
        ans.append(max(len(str(int(i))),len(str(int(N/i))))) 
        print(ans)
print(min(ans)) 




# print(a) 





# count = 0
# while(a>0):
#     count += 1
#     a /= 10
#     a = int(a)
# print(count)

n = int(input())
import math
ans = []
for i in range(1,int(math.sqrt(n)+1)):
    if n%i == 0:
        ans.append(max(len(str(i)),len(str(int(n//i)))))
print(min(ans))

Verdicts: Wrong Answer

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

Submission attempts (in order):
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


import sys,math
n = int(input())
ans = sys.maxsize
for i in reversed(range(1, math.sqrt(n).__int__() + 1)):
    if n % i == 0:
        cur = max(len(str(i)), len((str(n // i))))
        if ans > cur:
            ans = cur

if n == 1:
    print(1)
else:
    print(ans)


Verdicts: Wrong Answer

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

Submission attempts (in order):
import math
N = int(input())
ans = math.inf
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N/i)))
print(ans)


import math
N = int(input())
ans = N
for i in range(1, 1+math.floor(math.sqrt(N))):
    if N % i == 0:
        ans = min(ans, len(str(N//i)))
print(ans)


Verdicts: Runtime Error

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

Submission attempts (in order):
from math import sqrt, ceil

def check(n):
    minf = len(str(n))
    square = ceil(sqrt(n)) # 10^5
    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

#print(check(10**10))
N = int(input())
print(check(N))


from math import sqrt, ceil

def check(n):
    minf = len(str(n))
    square = ceil(sqrt(n)) # 10^5
    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

#print(check(10**10))
N = int(input())
print(check(N))


Verdicts: Wrong Answer

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

Submission attempts (in order):
def main():
    n = int(input())

    m = int(n ** 0.5)
    if n < 4:
        m += 1

    for i in reversed(range(1, m + 1)):
        if n % i == 0:
            b = n // i
            db = len(str(b))
            di = len(str(i))
            print(abs(db - di))
            break


if __name__ == '__main__':
    main()


def main():
    n = int(input())

    m = int(n ** 0.5)
    if n < 4:
        m += 1

    min_f = len(str(n))

    for i in reversed(range(1, m + 1)):
        if n % i == 0:
            b = n // i
            db = len(str(b))
            di = len(str(i))
            f = max(db, di)
            if f < min_f:
                min_f = f

    print(min_f)


if __name__ == '__main__':
    main()


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())
if n < 10:
  print(1)
else:
  sqn = int(n**0.5)
  c = float("inf")
  for i in range(1, sqn):
    if n%i == 0:
      d = max(i//10, (n//i)//10)
      c = min(c, d)
  print(c)

n = int(input())
if n < 10:
  print(1)
else:
  sqn = int(n**0.5)
  c = float("inf")
  for i in range(1, sqn+1):
    if n%i == 0:
      d = max(len(str(i)), len(str(n//i)))
      c = min(c, d)
  print(c)

Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
x = int(n**.5)
while N%x:
  x-=1

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

N = int(input())
K = int(n**(1/2))
a = len(str(N))

for i in range(1,k+1):
  if N%i==0:
    a=len(str(n//i))

print(a)

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

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

N = int(input())
n = int(N**0.5)

while N%n:
  n-=1

print(len(str(N//n)))

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
N=int(input())
M=int((N**(1/2)))

print(min([max([len(str(i)),len(str(int(N/i)))]) for i in range(int(N/2)-M,int(N/2)+M) if N%i==0]))

N=int(input())
M=int((N**(1/2)))
print(min([max([len(str(i)),len(str(int(N/i)))]) for i in range(1,M+1) if N%i==0]))


Verdicts: Runtime Error

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

Submission attempts (in order):
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)

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)


Verdicts: Wrong Answer

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

Submission attempts (in order):
b = input()
a =int(b)
m = len(b)
for i in reversed(range(1,int(math.sqrt(a))+1)):
    if a/i == int(a/i):
        m = max(len(str(a//i)),len(str(i)))
        break
print(m)

n = int(input())

def cal(a):
  return len(str(a))
m = 11
for j in range(1,10**5+1):
  if n%j==0:
    m = min(m,max(cal(j),cal(n//j)))
    # print(m)
print(m)

Verdicts: Runtime Error

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

Submission attempts (in order):
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))

def f(x,y):
    count_x, count_y = 1, 1
    while x/10>=1:
        x = x//10
        count_x += 1
    while y/10>=1:
        y = y//10
        count_y += 1
    return max(count_x, count_y)

pf = []
m = int(input())

for i in range(1,int(m**0.5)+1):
    if m%i == 0:
        pf.append(i)

print(f(pf[-1], m/pf[-1]))

Verdicts: Wrong Answer

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

Submission attempts (in order):
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)
  

N = int(input())

F = 1
F_min = 10**10

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


Verdicts: Wrong Answer

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

Submission attempts (in order):
n = int(input())

def primefact(n):
    x = 0
    table = []
    for i in range(2, int(n ** 0.5) + 1):
        while n % i == 0:
            n //= i
            x += 1
            
        if x != 0:
            table.append([i, x])
        x = 0

    if n != 1:
        table.append([n, 1])
        
    return table
"""
    if len(table) == 0:
        table.append([n, 1])
"""
    
bunkai = primefact(n)

a = 1
b = 1
bunkai = list(reversed(bunkai))

for i in range(len(bunkai)):
    while bunkai[i][1] != 0:
        if a < b:
            a *= bunkai[i][0]
        else:
            b *= bunkai[i][0]
        bunkai[i][1] -= 1
        
a = int(a)
b = int(b)
c = max(a, b)
print(len(str(c))-1)
        
        
        


n = int(input())
a = 1
b = n
for i in range(1, int(n ** 0.5) + 1):
    if n % i == 0:
        a = i
        b = n // i
      

c = max(a, b)
print(len(str(c)))    


Verdicts: Wrong Answer

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

Submission attempts (in order):
N = int(input())
ans = N
for i in range(1, N):
    if N*i > N:
        break
    d = 0
    if N % i == 0:
        d = max(len(str(i)), len(str(N//i)))
        ans = min(ans, d)
print(ans)

N = int(input())
ans = N
for i in range(1, N):
    if i**2 > N:
        break
    d = 0
    if N % i == 0:
        d = max(len(str(i)), len(str(N//i)))
        ans = min(ans, d)
print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
import math

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

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

import math

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

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

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

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
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)

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)

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)

Verdicts: Wrong Answer

Wrong Answer

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

Submission attempts (in order):
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())
list =  make_divisors(N)
ans = 10**9
for i in range(0,len(list),2):
  tmp1 = len(str(list[i]))
  tmp2 = len(str(list[i+1]))
  ans = min(ans,max(tmp1,tmp2))
print(ans)


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())
list =  make_divisors(N)
ans = 10**9
if len(list)%2==1:
    list.append(list[-1])
for i in range(0,len(list),2):
    tmp1 = len(str(list[i]))
    tmp2 = len(str(list[i+1]))
    ans = min(ans,max(tmp1,tmp2))
print(ans)

Verdicts: Runtime Error

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

Submission attempts (in order):
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main()
{
    ll N;
    cin >> N;
    int res = 30;
    for(ll i = 1; i*i <= N; ++i) {
        if(N%i) continue;
        ll j = N/i;
        int cnt = 0;
        while(j > 0) ++cnt, j /= 10;
        res = min(res, cnt);
    }
    cout << res << endl;
    return 0;
}

import sys
input = sys.stdin.readline

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

def main():
    N = int(input())
    a = make_divisors(N)
    a.sort()
    ans = 10
    for i in a:
        ans = min(ans, len(str(max(i, N/i))))
    
    print(ans)

if __name__ == '__main__':
    main()

Verdicts: Runtime Error

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

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

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

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

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):
n = int(input())
half = min(n//10**(len(str(n))//2),n%10**(len(str(n))//2))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(half)

n = int(input())
half = min(n//10**(len(str(n))//2),n%10**(len(str(n))//2))

ans = []
for i in range(half+10, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

import fractions
n = int(input())
half = int(fractions.sqrt(n))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

n = int(input())
half = min(n//10**(len(str(n))//2),n%10**(len(str(n))//2))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

n = int(input())
half = min(n//10**(len(str(n))//2),n%10**(len(str(n))//2))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

import math
n = int(input())
half = int(math.sqrt(n))

ans = []
for i in range(half, 0, -1):
    if n%i==0:
        ans.append(max(len(str(i)), len(str(n//i))))
print(min(ans))

Verdicts: Wrong Answer

Wrong Answer

Runtime Error

Runtime Error

Runtime Error

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

Submission attempts (in order):
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))
        

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**(i+1))-1,(10**i)-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))

Verdicts: Wrong Answer

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

Submission attempts (in order):
def divisible_length(n):
    min_length = len(str(n))
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            min_length = min(min_length, len(str(i)))
            if i != n // i:
                min_length = min(min_length, len(str(n // i)))
    return min_length

n = int(input())
print(divisible_length(n))

def divisible_length(n):
	min_length = len(str(n))
  	for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            min_length = min(min_length, len(str(i)))
            if i != n // i:
	            min_length = min(min_length, len(str(n // i)))
    return min_length


n = int(input())
print(divisible_length(n))

def divisible_length(n):
    min_length = len(str(n))
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            min_length = min(min_length, max(len(str(i)), len(str(n // i))))
    return min_length

n = int(input())
print(divisible_length(n))

Verdicts: Wrong Answer

Runtime Error

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

Submission attempts (in order):
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)



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)



Verdicts: Wrong Answer

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

Submission attempts (in order):
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))))

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

Verdicts: Wrong Answer

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

Submission attempts (in order):
import itertools

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

f = factorization(n)

print(f)

if len(f) == 1:
    print(len(str(n)))
else:
    pf = []
    for r in f:
        pf += [r[0]]*r[1]
    ans = len(str(n))
    for i in range(1,len(pf)//2+2):
        for c in itertools.combinations(pf, i):
            tmp = 1
            for t in c:
                tmp *= t
            ans = min(ans, max(len(str(tmp)), len(str(n//tmp))))
    print(ans)

import itertools

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

f = factorization(n)

#print(f)

if len(f) == 1 and f[0][1] == 1:
    print(len(str(n)))
else:
    pf = []
    for r in f:
        if r[0] == 1:
            continue
        pf += [r[0]]*r[1]
    ans = len(str(n))
    for i in range(1,len(pf)//2+1):
        for c in itertools.combinations(pf, i):
            #print(c)
            tmp = 1
            for t in c:
                tmp *= t
            ans = min(ans, max(len(str(tmp)), len(str(n//tmp))))
    print(ans)

Verdicts: Wrong Answer

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

Submission attempts (in order):
import math

N = int(input())
end = int(math.sqrt(N))+1
ans = len(str(N))

for a in range(1,end):
  if N%a == 0:
    b = N//a
    ans = min(ans, len(str(max(a,b)))
print(ans)


import math

N = int(input())
end = int(math.sqrt(N))+1
ans = len(str(N))

for a in range(1,end):
  if N%a == 0:
    b = N//i
    ans = min(ans, len(str(max(a,b)))
print(ans)


N = int(input())

import math

end = int(math.sqrt(N))+1
ans = len(str(N))

for a in range(1,end):
  if N % a ==0:
    b = N//a
    ans = min(ans, len(str(max(a,b))))
print(ans)

Verdicts: Runtime Error

Runtime Error

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

Submission attempts (in order):


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


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


# while up_n <= N:
#   if N % up_n == 0:


    
#     break
#   else:
#     up_n+=1

# print(up_ans)



import math
N=int(input())


root_n = int(math.sqrt(N))
up_n = root_n
up_ans = 0
keta = lambda x: len(str(x))
while up_n <= N:
  if N % up_n == 0:
    pair = int(N/up_n)
    
    up_ans = max(keta(pair), keta(up_n))
    break
  else:
    up_n-=1

print(up_ans)



Verdicts: Wrong Answer

Accepted