TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: There are N students and M checkpoints on the xy-plane.   The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j).   When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_.   The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.   Here, |x| denotes the absolute value of x.   If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.   Which checkpoint will each student go to?

Submission attempts (in order):
MM = input().split()
N = int(MM[0])
M = int(MM[1])
list1 = []
list2 = []
for i in range(N):
  LL = input().split()
  list1.append(LL)
print(list1)
for i in range(M):
  MM = input().split()
  list2.append(MM)
print(list2)
for i in list1:
  mini = 40**8
  ans = 0
  for j in range(len(list2)):
    x = int(i[0]) - int(list2[j][0])
    y = int(i[1]) - int(list2[j][1])
    xx = abs(x) + abs(y)
    if xx < mini:
      mini = xx
      ans = j+1
  print(ans)
      

MM = input().split()
N = int(MM[0])
M = int(MM[1])
list1 = []
list2 = []
for i in range(N):
  LL = input().split()
  list1.append(LL)

for i in range(M):
  MM = input().split()
  list2.append(MM)

for i in list1:
  mini = 40**8
  ans = 0
  for j in range(len(list2)):
    x = int(i[0]) - int(list2[j][0])
    y = int(i[1]) - int(list2[j][1])
    xx = abs(x) + abs(y)
    if xx < mini:
      mini = xx
      ans = j+1
  print(ans)

Verdicts: Wrong Answer

Accepted
Problem: There are N students and M checkpoints on the xy-plane.   The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j).   When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_.   The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.   Here, |x| denotes the absolute value of x.   If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.   Which checkpoint will each student go to?

Submission attempts (in order):
n, m = map(int, input().split())
AB = [[int(i) for i in input().split()] for i in range(n)]
CD = [[int(i) for i in input().split()] for i in range(m)]

for a, b in AB:
    dist = 10 ** 12
    for i, cd in enumerate(CD):
        tmp = abs(a - cd[0]) + abs(b - cd[1])
        if tmp < dist:
            dist = tmp
            ans = i + 1
            
print(ans)

n, m = map(int, input().split())
AB = [list(map(int, input().split())) for i in range(n)]
CD = [list(map(int, input().split())) for i in range(m)]

for a, b in AB:
    dist = [[abs(a - c) + abs(b - d)] for c, d in CD]
    print(dist.index(min(dist)) + 1)

Verdicts: Wrong Answer

Accepted
Problem: There are N students and M checkpoints on the xy-plane.   The coordinates of the i-th student (1 \leq i \leq N) is (a_i,b_i), and the coordinates of the checkpoint numbered j (1 \leq j \leq M) is (c_j,d_j).   When the teacher gives a signal, each student has to go to the nearest checkpoint measured in _Manhattan distance_.   The Manhattan distance between two points (x_1,y_1) and (x_2,y_2) is |x_1-x_2|+|y_1-y_2|.   Here, |x| denotes the absolute value of x.   If there are multiple nearest checkpoints for a student, he/she will select the checkpoint with the smallest index.   Which checkpoint will each student go to?

Submission attempts (in order):
n,m=map(int,input().split())

a_lis=[list(map(int,input())) for i in range(n)]
c_lis=[list(map(int,input())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**8
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
    

n,m=map(int,input().split())

a_lis=[list(map(int,input())) for i in range(n)]
c_lis=[list(map(int,input())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
    

n,m=map(int,input().split())

a_lis=[list(map(int,input().split())) for i in range(n)]
c_lis=[list(map(int,input().split())) for i in range(m)]

for i in range(n):
  num=0
  ans=10**10
  for j in reversed(range(m)):
    a=a_lis[i]
    c=c_lis[j]
    num=abs(a[0]-c[0])+abs(a[1]-c[1])
    ans=min(ans,num)
    if num==ans:
      cnt=j+1
  print(cnt)
    


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

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

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

import math


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

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

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 cal1(n):
    num=(n**0.5)//1+1
    for i in range(num,n+1):
        if n//i==0:
            num=i
            break
    return num

import math

N=int(input())
num=cal1(N)
print(int((math.log(num,10)+1)//1))

def cal(N):
    num=(N**0.5)//1
    num=int(num)
    for i in range(num,0,-1):
       if N%i==0:
           k=int(N/i)
           x=len(str(k))
           break
    return x

print(cal(int(input())))

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())
ans=10
for i in range(1,10**5+1):
  if n%i==0:
    ans=min(ans,len(str(n//i)))
print(ans)

n=int(input())
ans=10
for i in range(1,10**5+1):
  if n%i==0 and n//i>=i:
    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):
import math
N = int(input())
for i in range(1,int(math.sqrt(N))+1):
    if N % i == 0:
        ans = math.log10(N // i) // 1 + 1
print(ans)

import math
N = int(input())
for i in range(1,int(math.sqrt(N))+1):
    if N % i == 0:
        ans = math.log10(N // i) // 1 + 1
print(int(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())
for i in range(1,1+int(N)):
    if N % i == 0:
        tmp = i
s = max(len(str(N // tmp)),len(str(tmp)))
ans = min(ans,s)

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

N = int(input())
for i in range(1,1+int(N)):
    if N % i == 0:
        tmp = i
s = max(len(str(N // tmp)),len(str(tmp)))
ans = min(ans,s)
print(ans)

N = int(input())
for i in range(1,1+int(N**(1/2))):
    if N % i == 0:
        tmp = i
print(max(len(str(N // tmp)),len(str(tmp))))


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())
def checklen(A, B):
    return max(len(str(A)), len(str(B)))

ans = float("inf")
for i in range(1,round(N/2):
    if N % i == 0:
        m = round(N/i)
        ans = min(checklen(i, m), ans)
print(ans)


import math

N = int(input())
def checklen(A, B):
    return max(len(str(A)), len(str(B)))

ans = float("inf")
M = round(math.sqrt(N))
for i in range(1, M+1):
    if N % i == 0:
        m = round(N/i)
        ans = min(checklen(i, m), ans)
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):
def getPrimeFactorsList(num):
  pn = 2 
  pflist = [] 
  while pn * pn <= num: 
    while num % pn == 0: 
      num = num / pn
      pflist.append(pn)
    pn += 1 
  if num > 1:
    pflist.append(int(num))
    
  return pflist

n = int(input())

pf = getPrimeFactorsList(n)
pf_r = reversed(pf)
print(pf)
a = 1
b = 1
for i in pf_r:
  if a >= b:
    b *= i
  else:
    a *= i

print(max([len(list(str(int(a)))), len(list(str(int(b))))]))


N = int(input())

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

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

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)


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())
nn = int(math.sqrt(n))
while n%i != 0: i-=1
print(len(str(n//i)))


import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
print(len(str(n/nn)))

import math
n = int(input())
nn = int(math.sqrt(n))
while n%nn != 0: nn-=1
ans = len(str(n/nn))
print(ans)

import math
n = int(input())
a = int(math.sqrt(n))
while n%a != 0: a-=1
print(len(str(n//a)))

Verdicts: Runtime Error

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):
from math import sqrt
N = int(input())
ans = []
for i in range(1, int(sqrt(N)) + 1):
    if i * (N // i) == N:
        ans.append(max(len(str(i)), len(str(N // i)))
print(min(ans))

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

N = int(input())
v = round(N ** 0.5)
while N % v != 0:
    v -= 1
print(len(str(N // v)))

Verdicts: Runtime Error

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())
def f(n):
  g = float('inf')
  for i in [j for j in range(1,math.ceil(n**0.5))+1 if n%j == 0]:
    if g > len(str(max(i,n//i))):
      g = len(str(max(i,n//i)))
    if g == float('inf'):
        g = 1
  return g
print(f(n))

n = int(input())
def f(n):
  g = float('inf')
  for i in range(1,n//2+1):
    if n % i == 0:
      if g > len(str(i))+len(str(n//i)):
        g = len(str(i))+len(str(n//i))
  return g
print(f(n))

import math
n = int(input())
def f(n):
  g = float('inf')
  for i in [j for j in range(1,math.ceil(n**0.5)+1) if n%j == 0]:
    if g > len(str(max(i,n//i))):
      g = len(str(max(i,n//i)))
    if g == float('inf'):
        g = 1
  return g
print(f(n))

Verdicts: Runtime Error

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

#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>

#include <stack>

#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>

using namespace std;


#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl


template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, pair<T1, T2> P)
{
    return s << '<' << P.first << ", " << P.second << '>';
}
template <class T>
ostream &operator<<(ostream &s, vector<T> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        if (i > 0)
        {
            s << " ";
        }
        s << P[i];
    }
    return s;
}
template <class T>
ostream &operator<<(ostream &s, vector<vector<T>> P)
{
    for (int i = 0; i < P.size(); ++i)
    {
        s << endl
          << P[i];
    }
    return s << endl;
}
template <class T>
ostream &operator<<(ostream &s, set<T> P)
{
    EACH(it, P) { s << "<" << *it << "> "; }
    return s << endl;
}
template <class T1, class T2>
ostream &operator<<(ostream &s, map<T1, T2> P)
{
    EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; }
    return s << endl;
}
typedef long long ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int func(long long num){
    int cnt = 0;
    while (num > 0)
    {
        num /= 10;
        cnt++;
    }
    return cnt;
}

int main()
{
    long long  n;
    cin >> n;
    int ans = INF;
    for (int i = 1; i <= sqrt(n) + 1; i++)
    {
        int tmp=INF;
        if (n % i == 0)
        {
            tmp = max(func(i), func(n / i));
            
        }
        ans = min(ans, tmp);
    }
    cout << ans << endl;
}

def func(num):
    cnt=0
    while(num>0):
        num/=10
        cnt+=1
    return cnt
N=int(input())
ans=100
for i in range(1,N**(1/2)+1):
    tmp=0
    if(N%i==0):
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
print(ans)


def func(num):
    cnt=0
    while(num>0):
        num=int(num/10)
        cnt+=1
    return cnt

N=int(input())
ans=100

for i in range(1,int(N**(1/2)+1)):
    
    tmp=100
    if(N%i==0):
        
        tmp=max(func(i),func(N/i))
    ans=min(ans,tmp)
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())
F = 999;
for i in range(1,int(sqrt(N))+1):
    
    if N%i == 0: 
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
        

N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    if N%i == 0: 
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
        

N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    print(i)
    
    if N%i == 0: 
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
        

from math import sqrt

# C-Digits in Multiplication


N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
    
    if N%i == 0: 
        F =  min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
        

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):
import math

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


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

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


if __name__ == '__main__':
    main()


import math

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


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

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


if __name__ == '__main__':
    main()


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):
for A in range(1, int((N / 2))):
    if N % A == 0:
        B = int(N / A)
        if len(str(A)) <= len(str(B)):
            res = len(str(B))
        elif len(str(A)) >= len(str(B)):
            res = len(str(A))
        cont.append(res)
    else:
        continue
print(min(cont))

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())
r = make_divisors(N)
res = []
for i in r:
    y = N // i
    res.append(max(len(str(y)), len(str(i))))
print(min(res))

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):
# -*- coding: utf-8 -*-
import sys
# from collections import defaultdict, deque
from math import log10, sqrt, ceil
def input(): return sys.stdin.readline()[:-1] # warning not \n


def c(x):
    cnt = 0
    n = x
    while n:
        n //= 10
        cnt += 1
    return cnt

def solve():
    n = int(input())
    o = n
    ans = c(n)
    for i in range(2, ceil(sqrt(n)) + 1):
        while (n % i == 0):
            n //= i
            a = n
            b = o // a
            print(a,b)
            ans = min(ans, max(c(a), c(b)))
        if n == 1:
            break

    print(ans)
    
        




t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""
1 -> (1, 2) -> (2 ** 3, 3) -> (3, 1)
100000007
"""



# -*- coding: utf-8 -*-
import sys
# from collections import defaultdict, deque
from math import log10, sqrt, ceil
def input(): return sys.stdin.readline()[:-1] # warning not \n


def c(x):
    cnt = 0
    n = x
    while n:
        n //= 10
        cnt += 1
    return cnt

def solve():
    n = int(input())
    o = n
    ans = c(n)
    for i in range(2, int(sqrt(n)) + 3):
        if (n % i == 0):
            a = i
            b = o // a
            ans = min(ans, max(c(a), c(b)))
        if i > n:
            break

    print(ans)
    
        




t = 1
# t = int(input())
for case in range(1,t+1):
    ans = solve()



"""
1 -> (1, 2) -> (2 ** 3, 3) -> (3, 1)
100000007
"""



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
# Here your code



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

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




# coding: utf-8
# Here your code



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

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




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):
from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(x)))


from math import sqrt
n = int(input())
x = n
i = 2
while i <= sqrt(n):
    if n % i == 0:
        x = n / i
    i += 1
print(len(str(int(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):
N = int(input()) 
ans = 111111111110
for i in range(int(N**0.5+2)):
    if N%i == 0:
        use = N//i 
        s = str(use) 
        t = str(i) 
        ans = min(ans, max(len(s), len(t))) 

print(ans)

N = int(input()) 
ans = 111111111110
for i in range(1,int(N**0.5+2)):
    if N%i == 0:
        use = N//i 
        s = str(use) 
        t = str(i) 
        ans = min(ans, max(len(s), len(t))) 

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

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

print(min(ans))


N = int(input())

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

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


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())
fmax = 0
for i in range(1,n//2+1):
  a = i
  b = n // i
  if b != n/i :
    continue
  
  alen = len(str(a))
  blen = len(str(b))
  f = max(alen, blen)
  fmax = max(fmax,f)
print(fmax)

n = int(input())
fmin = 100
for i in range(1,int(n**0.5)+1):
  a = i
  b = n // i
  if b != n/i :
    continue
  
  alen = len(str(a))
  blen = len(str(b))
  f = max(alen, blen)
  fmin = min(fmin,f)
print(fmin)

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())
l = []
for i in range(1, int(math.sqrt(n)//1)):
    if n % i == 0:
        l.append(int(n / i))
print(len(str(l[-1])))

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

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

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)

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)

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

#include <algorithm>
#include <cmath>
#include <string>


using namespace std;


long long f(long long a, long long b)
{
  string x=to_string(a), y=to_string(b);
  return max(x.length(), y.length());
}


int main()
{
  long long n, i, minv=100000000000;

  cin >> n;
  i = 1;
  while (i <= (long long)sqrt((long long)n)){
    if (n%i == 0 && f(i, n/i) < minv) minv = f(i, n/i);
    i++;
  }
  cout << minv << endl;
  
  return 0;
}


import math


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


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

    i = 1
    minv = 100000000000
    while i <= int(math.sqrt(n)):
        if n%i == 0 and f(i, n//i) < minv:
            minv = f(i, n//i)
        i += 1
    print(minv)
    

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())
nmax = math.floor(math.sqrt(N))
Bdigimax = 1
for i in range(1,nmax):
	if N % i == 0:
		Bdigi = math.log10(N/i)
		if Bdigimax < Bdigi:
			Bdigimax = Bdigi
print(int(Bdigimax))


import math
N=int(input())
if N==1:
	print(1)
else:
	nmax = math.ceil(math.sqrt(N))
	Bdigimin = 10
	for i in range(nmax):
		if N % (i+1) == 0:
			Bdigi = math.floor(math.log10(N/i))
			if Bdigimin > Bdigi:
				Bdigimin = Bdigi
	print(int(Bdigimin+1))


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


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())
import math
ans=[]
ans_i=[]
for i in range(1,int(math.sqrt(n))):
    if n%i==0:
        ans.append(i)
        ans_i.append(n//i)
v=list(str(max(max(ans,ans_i))))
print(len(v))

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

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):
# C - Digits in Multiplication
N = int(input())

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

print(ans)


# C - Digits in Multiplication
N = int(input())

A = int(N**0.5)
# print(A)
ans = 1
for i in range(A,0,-1):
    if N % i == 0:
        tmp = N / i
        ans = len(str(int(tmp)))
        break
    else:
        pass

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):
N, Y = map(int, input().split())
for i in range(N + 1):
    for j in range(N + 1 - i):
        k = int((Y - 10000 * i - 5000 * j) / 1000)
        if N - i - j >= k >= 0 and i + j + k == N:
            print(i, j, k)
            exit()
print(-1, -1, -1)

N = int(input())
l = []
for A in range(1, int(N ** 0.5) + 1):
    B = N // A
    if N == A * B:
        
        l.append(max(len(str(A)), len(str(B))))
        
print(min(l))

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

def divisor(N):
    '''
    create divisor_list < sqrt(N) from natural number
    '''
    divisor_list = []
    
    for num in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % num == 0:
            divisor_list.append(num)
    
    return divisor_list
    
def F(A, B):
    return max(len(str(A)), len(str(B)))
  
def minimumF(N):
    factoring_list = divisor(N)
    
    candidate_list = []
    
    for A in factoring_list:
        B = N // A
        candidate_list.append(F(A, B))
        
    return min(candidate_list)
  
print(minimumF(N))

import math

N = int(input())
 
def divisor(N):
    '''
    create divisor_list < sqrt(N) from natural number
    '''
    divisor_list = []
    
    for num in range(1, math.ceil(math.sqrt(N)) + 1):
        if N % num == 0:
            divisor_list.append(num)
    
    return divisor_list
    
def F(A, B):
    return max(len(str(A)), len(str(B)))
  
def minimumF(N):
    factoring_list = divisor(N)
    
    candidate_list = []
    
    for A in factoring_list:
        B = N // A
        candidate_list.append(F(A, B))
        
    return min(candidate_list)
  
print(minimumF(N))

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


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


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


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

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

print(min(l2))


Verdicts: Wrong Answer

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):
import numpy as np


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


def F(A, B):
    C = np.vstack((A, B))
    digit_C = np.array(np.log10(C) + 1, dtype = int)
    return np.max(digit_C, axis = 0)


dividend = np.ones(N) * N

divisor = np.arange(1, N + 1)

residue = dividend % divisor


A = divisor[residue == 0]
B = quotient[residue == 0]


print(np.min(F(A, B)))

import numpy as np


N = int(input())


def F(A, B):
    C = np.vstack((A, B))
    digit_C = np.array(np.log10(C) + 1, dtype = int)
    return np.max(digit_C, axis = 0)


divisor = np.arange(1, int(N ** 0.5) + 1)

quotient = N // divisor
residue = N % divisor


A = divisor[residue == 0]
B = quotient[residue == 0]


print(np.min(F(A, B)))

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())
min_digits = 12
for a in range(1, round(math.sqrt(N))+1):
    if N%a !=0:
        continue
    b = N//a
    print(a, b)
    digits = max(len(str(a)), len(str(b)))
    if digits < min_digits:
        min_digits = digits
print(min_digits)

import math
N = int(input())
min_digits = 12
for a in range(1, round(math.sqrt(N))+1):
    if N%a !=0:
        continue
    b = N//a
    digits = max(len(str(a)), len(str(b)))
    if digits < min_digits:
        min_digits = digits
print(min_digits)

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())
m = n * 1

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

sqr = int(n**0.5)
l1 = len(str(sqr))

pf = {}
for i in range(2, int(m**0.5) + 1):
    while not m % i:
        pf[i] = pf.get(i, 0) + 1
        m //= i
if m > 1:
    pf[m] = 1

ls = sorted(pf.items(), key=lambda x: x[0], reverse=True)
l2 = len(str(ls[0][0]))
other = n // ls[0][0]
l3 = len(str(other))

print(max(l1, l2, l3))


n = int(input())
m = n * 1

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

sqr = int(n**0.5)
l1 = len(str(sqr))

pf = {}
for i in range(2, int(m**0.5) + 1):
    while not m % i:
        pf[i] = pf.get(i, 0) + 1
        m //= i
if m > 1:
    pf[m] = 1

ls = sorted(pf.items(), key=lambda x: x[0], reverse=True)
l2 = len(str(ls[0][0]))
other = n // ls[0][0]
l3 = len(str(other))

if l1 <= l2 < l3:
    print(l3)
else:
    print(max(l1, l2))


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 numpy as np
N = int(input())
ans = 10 ** 10
for i in range(2:int(np.sqrt(N)) + 2):
    if not N % i:
        a = max(len(str(i)), len(str(int(121 / 11))))
        ans = min(ans, a)
print(a)

import numpy as np
 
N = int(input())
ans = len(str(N))
for i in range(2, int(np.sqrt(N)) + 2):
    if not N % i:
        a = max(len(str(i)), len(str(int(N / i))))
        ans = min(ans, a)
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):
N = int(input())

ans1 = 0

A = '1'
B = str(N)

if len(A)>=len(B):
    ans = len(A)
else:
    ans = len(B)
    
for i in range(2,N+1):
    A = i
    if N%A==0:
        B = int(N / A)
        A = str(A)
        B = str(B)
        print(A, B)
        if len(A)>=len(B):
            ans1 = len(A)
        else:
            ans1 = len(B)
        if ans1 <= ans:
            ans = ans1
    if len(str(A))==len(str(B)):
        break
print(ans)


N = int(input())

ans1 = 0

A = '1'
B = str(N)

if len(A)>=len(B):
    ans = len(A)
else:
    ans = len(B)
    
for i in range(2,N+1):
    A = i
    if N%A==0:
        B = int(N / A)
        A = str(A)
        B = str(B)
        print(A, B)
        if len(A)>=len(B):
            ans1 = len(A)
        else:
            ans1 = len(B)
        if ans1 <= ans:
            ans = ans1
    if len(str(A))==len(str(B)):
        break
print(ans)


import math

N = int(input())

ans1 = 0

A = '1'
B = str(N)

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

        if len(A)>=len(B):
            ans1 = len(A)
        else:
            ans1 = len(B)
        if ans1 <= ans:
            ans = ans1
    if len(str(A))==len(str(B)):
        break
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())
ele = []
i = 1
while i * i < n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
    i += 1

k = min(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)

 n = int(input())
ele = []
i = 1
while i * i <= n:
    if n % i == 0:
        ele.append([len(str(i)),len(str(n // i))])
    i += 1

k = max(ele[0][1],ele[0][0])
for i in range(len(ele)):
    k = min(max(ele[i][0],ele[i][1]),k)
print(k)

n = int(input())

e = []
i = 1
while i * i <= n:
    if n % i == 0:
        e.append([str(i),str(n//i)])
    i += 1

ans = 10**9
for i in range(len(e)):
    ans = min(max(len(e[i][1]),len(e[i][0])),ans)
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())
ans = len( str(N))
for i in range(1,int( N**(1/2))+1):
    if N%i == 0:
        ans = min( ans, max( len(i), len(N//i)))
        break
print(ans)

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

N = int( input())
ans = len(N)
for i in range(N//2,N):
    if N%i == 0:
        ans = min( ans, len(i))
        break
print(ans)

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

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

n=int(input())

x=int(n**0.5)

for i in range(x,0,-1):
    if n%i==0:
        a=str(i)
        b=str(n//i)
        print(max(len(a),len(b)))
        break

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

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)

    
    

    


import math

n = int(input())

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

ans = 10**10

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

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

print(ans)

Verdicts: Wrong Answer

Accepted