s_id stringlengths 10 10 | p_id stringlengths 6 6 | u_id stringlengths 10 10 | date stringlengths 10 10 | language stringclasses 1
value | original_language stringclasses 11
values | filename_ext stringclasses 1
value | status stringclasses 1
value | cpu_time stringlengths 1 5 | memory stringlengths 1 7 | code_size stringlengths 1 6 | code stringlengths 1 539k |
|---|---|---|---|---|---|---|---|---|---|---|---|
s926751358 | p03775 | u020604402 | 1551836301 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 2940 | 149 | 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) |
s544467668 | p03775 | u020604402 | 1551836289 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 2940 | 138 | 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) |
s463443090 | p03775 | u392029857 | 1551635009 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 319 | N = int(input())
rootn = int(N**0.5) +1
A = range(1, rootn)
min_digits = 11
for i in A:
if (N % A) == 0:
B = N // A
p, q =len(str(A)), len(str(B))
if (p > q) and p < min_digits:
min_digits = p
elif (p <= q) and q < min_digits:
min_digits = q
print(min_digits) |
s760653180 | p03775 | u392029857 | 1551634936 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 338 | N = int(input())
rootn = int(N*0.5) +1
A = range(1, rootn)
min_digits = 11
for i in A:
if (N % A) == 0:
B = N // A
p, q =len(str(A)), len(str(B))
if (p > q) and p < min_digits:
min_digits = p
elif (p <= q) and q < min_digits:
min_digits = q
print(min_digits)
|
s434556326 | p03775 | u235905557 | 1551567489 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38460 | 314 | def f(a, b):
al = len(str(a))
bl = len(str(b))
if al > bl:
return al
return bl
N = int(input())
n = int(N**0.5)
result = 12
for i in range(1, n+1):
for j in range(1, n+1):
if i*j == N:
r = f(i, j)
if r < result:
result = r
print result()
|
s112699653 | p03775 | u496744988 | 1551208005 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 215 | n=int(input())
ans = len(str(n))
l = [ i for i in range(1,n+1) if i*i < n]
for a in l:
if n % a == 0 and ans > max(len(str(a)),len(str(int(n / a))))
ans = max(len(str(a)),len(str(int(n / a))))
print(ans) |
s262186076 | p03775 | u496744988 | 1551206474 | Python | Python (3.4.3) | py | Runtime Error | 32 | 2940 | 212 | import math
n=int(input())
ans = len(str(n))
for a in range(1,int(math.sqrt(n)+1)):
if n % a == 0 and ans > max(len(str(a)),len(str(int(n / a))))
ans = max(len(str(a)),len(str(int(n / a))))
print(ans) |
s328087897 | p03775 | u496744988 | 1551206423 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 264 | import math
n=int(input())
ans = len(str(n))
# print(int(math.sqrt(n)))
for a in range(1,int(math.sqrt(n)+1)):
# print(a,n/a,n % a)
if n % a == 0 and ans > max(len(str(a)),len(str(int(n / a))))
ans = max(len(str(a)),len(str(int(n / a))))
print(ans) |
s275730405 | p03775 | u411858517 | 1550894586 | Python | Python (3.4.3) | py | Runtime Error | 35 | 3064 | 438 | N = int(input())
def prime_factor(n):
i = 2
table = [1]
while i * i <= n:
while n % i == 0:
n //= i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
res = prime_factor(N)
tmp = 1
tmp2 = N
for i in range(len(res)):
if len(str(tmp)) >= len(str(tmp2)):
break
count = tmp2
tmp2 = tmp2//res[i]
tmp *= res[i]
print(len(str(count))) |
s582236352 | p03775 | u072606168 | 1550194156 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 252 | 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)) |
s605862871 | p03775 | u859897687 | 1549857635 | Python | Python (3.4.3) | py | Runtime Error | 41 | 2940 | 167 | N = int(input())
m = int(N **0.5)
for i in range(1,m):
j = N // i
if i*j < N:
continue
k = i
a = N // k
ans=0
b = str(a)
ans = len(b)
print(ans)
|
s736021601 | p03775 | u859897687 | 1549857207 | Python | Python (3.4.3) | py | Runtime Error | 55 | 3064 | 182 | N = int(input())
m = int(N **0.5)
for i in range(1,m):
j = N / i
if int(j) < j:
continue
k = i
a = N // k
ans=0
while a >= 1:
a //=10
ans+=1
print(ans)
|
s389461806 | p03775 | u494058663 | 1549521069 | Python | Python (3.4.3) | py | Runtime Error | 31 | 3064 | 354 | import math
N = int(input())
A = []
B = []
F = []
for i in range(1,int(math.sqrt(N)),1):
if (N%i)== 0:
A.append(N/i)
B.append(i)
for i in range(len(A)):
count_A = int(math.log10(A[i])+1)
count_B = int(math.log10(B[i])+1)
if count_A >= count_B:
F.append(count_A)
else:
F.append(count_B)
print(min(F))
|
s055994095 | p03775 | u494058663 | 1549519868 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 344 | import math
N = int(input())
A = []
B = []
F = []
for i in range(1,int(N/2),1):
if (N%i)== 0:
A.append(N/i)
B.append(i)
for i in range(len(A)):
count_A = int(math.log10(A[i])+1)
count_B = int(math.log10(B[i])+1)
if count_A >= count_B:
F.append(count_A)
else:
F.append(count_B)
print(min(F))
|
s655313155 | p03775 | u494058663 | 1549519519 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 337 | import math
N = int(input())
A = []
B = []
F = []
for i in range(1,N/2):
if (N%i)== 0:
A.append(N/i)
B.append(i)
for i in range(len(A)):
count_A = int(math.log10(A[i])+1)
count_B = int(math.log10(B[i])+1)
if count_A >= count_B:
F.append(count_A)
else:
F.append(count_B)
print(min(F))
|
s382394507 | p03775 | u494058663 | 1549519213 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3188 | 335 | import math
N = int(input())
A = []
B = []
F = []
for i in range(1,N):
if (N%i)== 0:
A.append(N/i)
B.append(i)
for i in range(len(A)):
count_A = int(math.log10(A[i])+1)
count_B = int(math.log10(B[i])+1)
if count_A >= count_B:
F.append(count_A)
else:
F.append(count_B)
print(min(F))
|
s183914749 | p03775 | u634208461 | 1549416334 | Python | Python (3.4.3) | py | Runtime Error | 34 | 3688 | 531 | from math import sqrt, floor
from functools import reduce
def factorization(N):
s = floor(sqrt(N))
result = []
for i in range(2, s + 1):
if N % i == 0:
r = 0
while(N % i == 0):
N //= i
r += 1
result += [i] * r
if result == []:
result = [1, N]
return result
N = int(input())
p = factorization(N)
a = int(reduce(lambda x, y: x * y, p[0::2]))
b = int(reduce(lambda x, y: x * y, p[1::2]))
print(max(len(str(a)), len(str(b))))
|
s794256329 | p03775 | u219607170 | 1548986142 | Python | PyPy3 (2.4.0) | py | Runtime Error | 605 | 111704 | 695 | from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())
def factorize(n):
# NOTE: if n == 1, return []
if n < 1:
raise Exception('Invalid input: n = {}'.format(n))
i = 2
ret = []
while i * i <= n:
while n % i == 0:
n //= i
ret.append(i)
i += 1
if n > 1:
ret.append(n)
return ret
A = factorize(N)
l = len(A)
def res(i, B, C):
if i >= l:
val = 1
for b in B:
val *= b
C.append(max(len(str(val)), len(str(N//val))))
return None
B.append(A[i])
res(i+1, B, C)
B.pop()
res(i+1, B, C)
return C
C = res(0, [], [])
print(min(C)) |
s648770915 | p03775 | u219607170 | 1548986093 | Python | Python (3.4.3) | py | Runtime Error | 1952 | 11292 | 695 | from sys import setrecursionlimit; setrecursionlimit(10**9)
N = int(input())
def factorize(n):
# NOTE: if n == 1, return []
if n < 1:
raise Exception('Invalid input: n = {}'.format(n))
i = 2
ret = []
while i * i <= n:
while n % i == 0:
n //= i
ret.append(i)
i += 1
if n > 1:
ret.append(n)
return ret
A = factorize(N)
l = len(A)
def res(i, B, C):
if i >= l:
val = 1
for b in B:
val *= b
C.append(max(len(str(val)), len(str(N//val))))
return None
B.append(A[i])
res(i+1, B, C)
B.pop()
res(i+1, B, C)
return C
C = res(0, [], [])
print(min(C)) |
s304837812 | p03775 | u219607170 | 1548986056 | Python | Python (3.4.3) | py | Runtime Error | 2024 | 11340 | 635 | N = int(input())
def factorize(n):
# NOTE: if n == 1, return []
if n < 1:
raise Exception('Invalid input: n = {}'.format(n))
i = 2
ret = []
while i * i <= n:
while n % i == 0:
n //= i
ret.append(i)
i += 1
if n > 1:
ret.append(n)
return ret
A = factorize(N)
l = len(A)
def res(i, B, C):
if i >= l:
val = 1
for b in B:
val *= b
C.append(max(len(str(val)), len(str(N//val))))
return None
B.append(A[i])
res(i+1, B, C)
B.pop()
res(i+1, B, C)
return C
C = res(0, [], [])
print(min(C)) |
s739497645 | p03775 | u785578220 | 1548357566 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 172 | 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) |
s408234716 | p03775 | u237362582 | 1547532211 | Python | Python (3.4.3) | py | Runtime Error | 28 | 3060 | 383 | import math
def divisor(num):
if num < 0:
return 0
elif num == 1:
return 1
else:
divisor_list = [1, ]
for i in range(2, int(math.sqrt(num) + 1)):
if num % i == 0:
divisor_list.append(i)
return divisor_list
n = int(input())
divisor_list = divisor(n)
minA = divisor_list[-1]
print(len(str(n//minA)))
|
s369740006 | p03775 | u126823513 | 1546429739 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 217 | import math
int_n = int(input())
li_res = list()
for a in range(1, int(math.sqrt(int_n))):
if int_n % a == 0:
b = int_n // a
li_res.append(max([len(str(a)), len(str(b))]))
print(min(li_res))
|
s666735171 | p03775 | u026102659 | 1545869852 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 278 | import math
N = int(input())
m = int(math.sqrt(N))
a = 0
ans = 0
count = 1
for i in range(m, 1, -1):
if N % i == 0:
a = i
break
a = max(a, (N//a))
while True:
if a >= 10:
count += 1
a = a// 10
else:
break
print(count)
|
s113607034 | p03775 | u397531548 | 1544497233 | Python | Python (3.4.3) | py | Runtime Error | 31 | 3188 | 131 | N=int(input())
a=[]
for i in range(1,int(N**(0.5))):
if N%i==0:
a.append(max(len(str(i)),len(str(N//i))))
print(min(a)) |
s250530881 | p03775 | u667458133 | 1543135783 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 547 | N = int(input())
array = []
r = 2
result = 11
while True:
while True:
if N % r == 0:
array.append(r)
N //= r
else:
break
if N == 1:
break
r += 1
for i in range(2 ** len(array)):
bin_i = bin(i)[2:]
bin_i = '0' * (len(array) - len(bin_i)) + bin_i
A = 1
B = 1
for j in range(len(bin_i)):
if bin_i[j] == '1':
A *= array[j]
else:
B *= array[j]
result = min(result, max(len(str(A)), len(str(B))))
print(result)
|
s177883682 | p03775 | u659100741 | 1541712245 | Python | Python (3.4.3) | py | Runtime Error | 31 | 3064 | 145 | import math
N = int(input())
ans = []
for i in range(1,round(math.sqrt(N))):
if N%i == 0:
ans.append(len(str(N//i)))
print(min(ans))
|
s464028590 | p03775 | u131405882 | 1541586755 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 251 | 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))
|
s589698835 | p03775 | u404676457 | 1541381089 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3316 | 480 | import math
import sys
n = int(input())
insu = {}
sq = math.ceil(math.sqrt(n))
for i in range(1, sq + 1):
if n % i == 0:
insu[i] = 1
insu[n // i] = 1
dct = sorted(insu.items())
for i in range(len(dct) // 2 + 1):
if len(dct) - i * 2 <= 1:
ans1 = dct[i][0]
ans2 = dct[len(dct) - i][0]
for i in range(1, 10):
if ans2 // 10 == 0:
print(i)
break
ans2 //= 10
sys.exit(0) |
s319473275 | p03775 | u293579463 | 1541169978 | Python | Python (3.4.3) | py | Runtime Error | 32 | 3064 | 287 | import math
N = int(input())
ans = []
def digits(n):
count = 1
while n // 10 != 0:
n = n // 10
count += 1
return count
for a in range(1, int(math.sqrt(N))):
if N % a == 0:
b = N // a
ans.append(max(digits(a), digits(b)))
print(min(ans)) |
s081086257 | p03775 | u199295501 | 1541083466 | Python | Python (3.4.3) | py | Runtime Error | 287 | 52032 | 697 | # -*- coding: utf-8 -*-
import itertools
N = int(input())
def primes(n):
primfac = []
d = 2
while d*d <= n:
while (n % d) == 0:
primfac.append(d) # supposing you want multiple factors repeated
n //= d
d += 1
if n > 1:
primfac.append(n)
return primfac
def F(a,b):
return max([len(str(a)), len(str(b))])
l = primes(N)
l.append(1)
ans = []
for i in range(1,len(l)//2+1):
comb = itertools.combinations(l, i)
comb = list(set(list(comb)))
for comblist in comb:
# print(tmp)
tmp = 1
for x in comblist:
tmp *= x
ans.append(F(tmp,N//tmp))
# print(ans)
print(min(ans))
|
s184984244 | p03775 | u607865971 | 1540439521 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3572 | 1261 | N = int(input())
divList = []
n = N
while n != 1:
if n % 2 == 0:
n = n // 2
divList.append(2)
continue
if n % 3 == 0:
n = n // 3
divList.append(3)
continue
newN = n
isFind = False
for i in range(6, (n**(1/2)) + 1, 6):
if n % (i - 1) == 0:
divList.append(i - 1)
newN = newN // (i - 1)
isFind = True
if n % (i + 1) == 0:
divList.append(i + 1)
newN = newN // (i + 1)
isFind = True
if isFind == True:
break
if isFind == False:
divList.append(n)
newN = 1
n = newN
# print(divList)
# print(divList)
t = [([1], [1])]
for d in divList:
newT = []
for ab in t:
a, b = ab[0], ab[1]
a_add = a[:]
a_add.append(d)
b_add = b[:]
b_add.append(d)
newT.append((a, b_add))
newT.append((a_add, b))
t = newT
# print(t)
from functools import reduce
a1 = [(reduce(lambda a, b:a * b, ab[0]), reduce(lambda a, b:a * b, ab[1]))
for ab in t]
# print(a1)
a2 = set([(len(str(ab[0])), len(str(ab[1]))) for ab in a1])
# print(a2)
a3 = [max(ab[0], ab[1]) for ab in a2]
# print(a3)
print(min(a3))
|
s497364973 | p03775 | u476418095 | 1538573206 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 177 | var
n,i,x:int64;
y:string;
begin
readln(n);
i:=1;
while i<=trunc(sqrt(n)) do
begin
if n mod i=0 then x:=n div i;
inc(i);
end;
str(x,y);
writeln(length(y));
end. |
s158117766 | p03775 | u201234972 | 1538187915 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 163 | 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) |
s220174403 | p03775 | u201234972 | 1538187646 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 140 | 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) |
s352971163 | p03775 | u201234972 | 1538187591 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | 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) |
s157109569 | p03775 | u659100741 | 1535665548 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 180 | import math
N = int(input())
answer = []
b = 0
for a in range(1,round(sqrt(N))+1):
if N%a == 0:
b = N//a
answer.append(max(len(str(a)), len(str(b))))
print(min(answer))
|
s153711230 | p03775 | u659100741 | 1535664785 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 164 | N = int(input())
answer = []
b = 0
for a in range(1,round(abs(N))):
if N%a == 0:
b = N//a
answer.append(max(len(str(a)), len(str(b))))
print(min(answer))
|
s651894420 | p03775 | u659100741 | 1535663999 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 200 | N = int(input())
answer = 1000
b = 0
for a in range(round(abs(N))):
if N&a == 0:
b = N/a
if answer < min(len(str(a)), len(str(b))):
answer = min(len(str(a)), len(str(b)))
print(answer) |
s845731308 | p03775 | u659100741 | 1535663973 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 194 | N = int(input())
answer = 1000
for a in range(round(abs(N))):
if N&a == 0:
b = N/a
if answer < min(len(str(a)), len(str(b))):
answer = min(len(str(a)), len(str(b)))
print(answer) |
s440687378 | p03775 | u492532572 | 1531012304 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 210 | import math
N = int(input())
min_f = 10
for n in range(1, math.sqrt(N)):
a = n
if N % n != 0:
continue
b = N / n
f = max(len(str(a)), len(str(b)))
min_f = min(min_f, f)
print(min_f) |
s126216386 | p03775 | u111202730 | 1530230548 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3316 | 186 | import math
N = int(input())
ans = []
for i in range(1, round(math.sqrt(N))):
if N % i == 0:
tmp = max(len(str(i)), len(str(N//i)))
ans.append(tmp)
print(min(ans)) |
s997447440 | p03775 | u503283842 | 1530133349 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 135 | n=int(input())
f=[]
for i in range(1,int(n**0.5)):
if n%i==0:
f.append(i)
f.append(int(n/i))
print(len(str(f[-1]))) |
s147756019 | p03775 | u624475441 | 1528500873 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 122 | F=lambda*m:max(len(str(x))for x in m);print(m)
N=int(input())
print(min(F(x,N//x)for x in range(1,int(N**.5)+1)if N%x==0)) |
s905122692 | p03775 | u624475441 | 1528500320 | Python | Python (3.4.3) | py | Runtime Error | 136 | 3060 | 110 | F=lambda*m:max(len(str(x))for x in m)
N=int(input())
print(min(F(x,N//x)for x in range(1,int(N**.5)+1)if N%x)) |
s155509423 | p03775 | u944209426 | 1524978234 | Python | Python (3.4.3) | py | Runtime Error | 32 | 3060 | 213 | n = int(input())
a,b=[],[]
for i in range(1,int(n**0.5)):
if n%i==0:
a.append(i)
b.append(n//i)
ans=[]
for i in range(len(a)):
ans.append(max(len(str(a[i])),len(str(b[i]))))
print(min(ans)) |
s476087875 | p03775 | u069838609 | 1524947028 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 284 | from math import sqrt, ceil, floor, log10
N = int(input())
min_f = ceil(log10(N))
for A in range(1, ceil(sqrt(N))):
if N % A != 0:
continue
else:
B = N // A
f = floor(max(log10(A), log10(B))) + 1
if f < min_f:
min_f = f
print(f)
|
s938907828 | p03775 | u069838609 | 1524946942 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 278 | from math import sqrt, ceil, floor, log10, inf
N = int(input())
min_f = inf
for A in range(1, ceil(sqrt(N))):
if N % A != 0:
continue
else:
B = N // A
f = floor(max(log10(A), log10(B))) + 1
if f < min_f:
min_f = f
print(f)
|
s709204382 | p03775 | u503901534 | 1524461470 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3292 | 301 | n = int(input())
import math as ms
dic = []
for i in range(1,ms.floor(n / 2) + 1):
if n % i == 0:
dic.append([i,n // i])
f = []
for i in range(len(dic)):
a = ms.floor(ms.log10(dic[i][0])) + 1
b = ms.floor(ms.log10(dic[i][1])) + 1
f.append(max(a,b))
print(min(f))
|
s353433058 | p03775 | u559823804 | 1524198294 | Python | Python (3.4.3) | py | Runtime Error | 61 | 3188 | 251 | from math import sqrt
from math import log10
n=int(input())
i=1
ans=13
j=0
while i<sqrt(n):
if n%i==0:
j=n/i
ans=int(min(ans,max(log10(i)+1,log10(j)+1)))
i+=1
if j==0:
ans=int(max(log10(i)+1,log10(j)+1))
print(ans)
|
s201741288 | p03775 | u620868411 | 1524141011 | Python | Python (3.4.3) | py | Runtime Error | 31 | 3060 | 241 | # -*- coding: utf-8 -*-
from math import sqrt,ceil,log10
n = int(input())
nsr = sqrt(n)
x = -1
for i in range(1,ceil(nsr)):
if n%i==0:
x = n//i
ret = ceil(log10(x))
if 10**(ret)==int(x):
print(ret+1)
else:
print(ret)
|
s510398441 | p03775 | u276192130 | 1522916112 | Python | Python (3.4.3) | py | Runtime Error | 2222 | 1773088 | 417 | import itertools
n = int(input())
n2 = n
i = 2
table = []
while i * i <= n:
while n % i == 0:
n //= i
table.append(i)
i += 1
if n > 1:
table.append(n)
temp = []
for i in range(len(table)):
temp += list(itertools.permutations(table, i))
ans = []
for i in temp:
s = 1
for j in i:
s *= j
a, b = s, n2//s
ans.append(max(len(str(a)), len(str(b))))
print(min(ans))
|
s629837244 | p03775 | u557171945 | 1522271401 | Python | PyPy3 (2.4.0) | py | Runtime Error | 2107 | 40044 | 196 | n = int(input())
dv = []
dved = []
for i in range(1,n):
if n%i==0 and not(i in dved):
dv.append(i)
dved.append(n//i)
if i in dved:
break
print(len(str(dved[-1])))
|
s737782819 | p03775 | u143492911 | 1519796307 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 190 | 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)) |
s787371352 | p03775 | u390958150 | 1519785501 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 229 | import math
n = int(input())
def order(a,b):
return max(len(str(int(a))),len(str(int(b))))
ans = []
for i in range(1,int(math.ceil(math.sqrt(n)))):
if n % i == 0:
ans.append(order(n/i,i))
print(min(ans)) |
s298825971 | p03775 | u390958150 | 1519784918 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 321 | n = int(input())
def order(a,b):
return max(len(str(int(a))),len(str(int(b))))
ans = []
numbers = []
for i in range(1,n):
if len(numbers) != 0:
if i > min(numbers):
break
if n % i == 0:
ans.append(order(n/i,i))
numbers.append(n/i)
print(min(ans))
|
s011055962 | p03775 | u925364229 | 1518282650 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3060 | 176 | from math import sqrt
N = int(input())
max_v = int(sqrt(N))
for num in range(max_v,1,(-1)):
if N % num == 0:
div = num
break
print(max(len(str(div)),len(str(N//max_v)))) |
s251965304 | p03775 | u486232694 | 1515654175 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3064 | 318 | import math
N = int(input())
def F(a, b):
a = len(str(a))
b = len(str(b))
if a > b:
return a
elif a < b:
return b
else:
return b
elements = []
for i in range(1, math.floor(math.sqrt(N+1))):
if N % i == 0: elements.append(i)
a = elements[-1]
b = N // a
print(F(a,b)) |
s315930496 | p03775 | u126747509 | 1504733889 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 452 | #include <iostream>
#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;
}
|
s482615788 | p03775 | u846372029 | 1502412294 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 323 | # Digits in Multiplication
N = int(input())
if num < 1:
l = []
elif num == 1:
l = [1]
else:
l = []
l.append(1)
[l.append(i) for i in range(2, num // 2 + 1) if num % i == 0]
l.append(num)
l = list(map(str,l))
L = len(l)
r = [max(len(l[i]), len(l[L-i-1])) for i in range(int((L+1)//2))]
print(min(r)) |
s639047394 | p03775 | u846372029 | 1502412034 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 189 | # Digits in Multiplication
N = int(input())
import sympy as sm
l = list(map(str, sm.divisors(N)))
L = len(l)
r = [max(len(l[i]), len(l[L-i-1])) for i in range(int((L+1)//2))]
print(min(r)) |
s283469378 | p03775 | u846552659 | 1496629474 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3060 | 192 | # -*- coding:utf-8 -*-
import math
N = int(input())
a = list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))
a.sort()
print(min(a)) |
s272119788 | p03775 | u846552659 | 1496629197 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3060 | 187 | # -*- coding:utf-8 -*-
import math
N = int(input())
print(sorted(list(set([max(int(math.log10(N//B))+1,int(math.log10(B))+1) for B in range(1,int(math.sqrt(N+1))) if N%B == 0 ]))).pop(0)) |
s316564463 | p03775 | u730654800 | 1494524789 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 3188 | 431 | while True:
N = int(input())
Y = list()
Z = list()
A = list()
Yd = list()
Zd = list()
for i in range(1,N+1):
if N % i == 0:
Y.append(i)
Yd.append(len(str(i)))
Z.insert(0,i)
Zd.insert(0,len(str(i)))
L = int(len(Y))
for i in range(L):
var = int(Yd[i]) * int(Zd[i])
A.append(var)
A.sort(reverse = True)
print(A[0])
|
s715877830 | p03775 | u894575359 | 1492851575 | Python | Python (3.4.3) | py | Runtime Error | 27 | 3060 | 162 | import math
f=lambda a,b:int(max(math.log10(a),math.log10(b))+1)
def g(n):
for i in range(1,int(n**0.5)):
if n%i==0:yield f(i,n//i)
print(min(g(int(input())))) |
s898376089 | p03775 | u059262067 | 1492802365 | Python | Python (3.4.3) | py | Runtime Error | 30 | 2940 | 156 | import math
a = int(input())
for i in range(1 , math.floor(math.sqrt(a))):
if a % i == 0:
ans = math.ceil(math.log10(a / i))
print(ans) |
s835687775 | p03775 | u059262067 | 1492801663 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 148 | import math
a = long(input())
for i in range(1 , math.ceil(math.sqrt(a))):
if a % i == 0:
ans = math.ceil(math.log10(a / i))
print(ans) |
s509193736 | p03775 | u059262067 | 1492801548 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3316 | 155 | import math
a = int(input())
for i in range(1 , math.ceil(math.sqrt(a))):
if a % i == 0:
ans = math.ceil(math.log10(a / i))
print(ans) |
s547758463 | p03775 | u059262067 | 1492801509 | Python | Python (3.4.3) | py | Runtime Error | 29 | 3060 | 186 | import math
a = int(input())
print(math.ceil(math.sqrt(a)))
for i in range(1 , math.ceil(math.sqrt(a))):
if a % i == 0:
ans = math.ceil(math.log10(a / i))
print(ans) |
s238060858 | p03775 | u450145303 | 1491884083 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 231 | from math import sqrt
def F(t):
return max(len(str(t[0])), len(str(t[1])))
N = long(input())
m = list(map(F,[(r,int(N / r)) for r in range(2, int(sqrt(N))) if N % r == 0]))
print(min(m)) if len(m) != 0 else print(len(str(N))) |
s808980676 | p03775 | u848485301 | 1491526096 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3060 | 237 | def keta(a):
count=1
while a>=10:
a/=10
count+=1
return count
stac=[]
N=int(input())
for i in range(1,int(N/2+1)):
if N%i==0:
j=int(N/i)
stac.append(max(keta(i),keta(j)))
print(min(stac)) |
s238581178 | p03775 | u775600206 | 1491202435 | Python | Python (2.7.6) | py | Runtime Error | 40 | 2568 | 216 |
import math
n = int(raw_input())
i = 1
# sqn = math.ceil(math.sqrt(n))
while math.sqrt(n) > i:
if n % i == 0:
ans = n / i
#ans = int(math.log10(n / i)) + 1
i += 1
print len(str(ans))#(ans) |
s596625610 | p03775 | u775600206 | 1491202410 | Python | Python (2.7.6) | py | Runtime Error | 40 | 2568 | 239 | # -*- coding: utf-8 -*-
import math
n = int(raw_input())
i = 1
# sqn = math.ceil(math.sqrt(n))
while math.sqrt(n) > i:
if n % i == 0:
ans = n / i
ans = int(math.log10(n / i)) + 1
i += 1
print len(str(ans))#(ans) |
s997098151 | p03775 | u775600206 | 1491202053 | Python | Python (2.7.6) | py | Runtime Error | 39 | 2568 | 202 | # -*- coding: utf-8 -*-
import math
n = int(raw_input())
i = 1
sqn = math.ceil(math.sqrt(n))
while math.sqrt(n) > i:
if n % i == 0:
ans = int(math.log10(n / i)) + 1
i += 1
print(ans) |
s619928698 | p03775 | u462626125 | 1491066429 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 65944 | 354 | import math
N = int(input())
def enum(N,A):
if(N % A == 0):
B = N // A
return (A,B)
else:
return 'NULL'
def F(tupleX):
t = max(tupleX)
return int(math.log10(t) + 1)
X = [] # 候補
for n in range(1,N):
X.append(enum(N,n))
Y = []
for x in X:
if (x == 'NULL'):
continue
else:
y = F(x)
Y.append(y)
print(min(Y)) |
s285671096 | p03775 | u462626125 | 1491065431 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 68760 | 207 | import math
N = int(input())
def solve(N,A):
if(N % A == 0):
B = N / A
return int(math.log10(max(A,B)) + 1)
else:
return -1
ans = []
for A in range(1,N):
ans.append(solve(N,A))
print(max(ans)) |
s584038670 | p03775 | u533084327 | 1491062307 | Python | Python (2.7.6) | py | Runtime Error | 12 | 2692 | 417 | mport numpy as np
def F(x,y):
count = 1
if x<=y:
while y >= 10:
y = y/10
count += 1
if x>y:
while x >= 10:
x = x/10
count += 1
return count
#print F(1,13)
N = input()
min = 10**10
for i in range(np.sqrt(N).astype(np.int32)):
if N%(i+1) == 0:
if min > F(i+1,N/(i+1)):
min = F(i+1,N/(i+1))
print i+1
print min |
s424193083 | p03775 | u054556734 | 1490816140 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 95 | import math
n = int(input())
nn = int(math.sqrt(n))
while n%i != 0: i-=1
print(len(str(n//i)))
|
s266151494 | p03775 | u243492642 | 1490726508 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 313 | # coding: utf-8
import math
num_N = int(input())
min_num = math.inf
sqrt_N = math.floor(math.sqrt(num_N))
for i in range(1, sqrt_N + 1):
if num_N % i == 0:
len_num_A = len(str(i))
len_num_B = len(str(int(num_N / i)))
min_num = min(min_num, max(len_num_A, len_num_B))
print(min_num) |
s943503100 | p03775 | u243492642 | 1490726271 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 309 | # coding: utf-8
import math
num_N = int(input())
min_num = math.inf
sqrt_N = math.floor(math.sqrt(num_N))
for i in range(1, sqrt_N + 1):
if num_N % i == 0:
len_num_A = len(str(i))
len_num_B = len(str(num_N // i))
min_num = min(min_num, max(len_num_A, len_num_B))
print(min_num) |
s648818906 | p03775 | u813098295 | 1490689346 | Python | Python (2.7.6) | py | Runtime Error | 34 | 2568 | 178 | N = int(raw_input())
for i in xrange(1, N):
if i*i == N:
t = i
break
elif i*i > N:
break
if N % i == 0:
t = i
print len(str(N/t)) |
s723089664 | p03775 | u813098295 | 1490689261 | Python | Python (2.7.6) | py | Runtime Error | 36 | 2568 | 178 | N = int(raw_input())
for i in xrange(1, N):
if i*i > N:
break
elif i*i == N:
t = i
break
if N % i == 0:
t = i
print len(str(N/t)) |
s471680518 | p03775 | u813098295 | 1490680552 | Python | Python (2.7.6) | py | Runtime Error | 28 | 2568 | 134 | N = int(raw_input())
for i in xrange(1, N):
if i*i > N:
break
if N % i == 0:
ans = len(str(N/i))
print ans |
s706768024 | p03775 | u243492642 | 1490661423 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 354 | # coding: utf-8
import math
num_N = int(input())
min_num = math.inf
for i in range(1, math.floor(math.sqrt(num_N)) + 1):
if num_N % i == 0:
num_A = i
num_B = int(num_N // i)
len_num_A = len(list(str(num_A)))
len_num_B = len(list(str(num_B)))
min_num = min(min_num, max(len_num_A, len_num_B))
print(min_num) |
s092671982 | p03775 | u075012704 | 1490643402 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 292 | N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
if N%i == 0: #余りが0 = iは整数なので整数同士の割り算ということ(余りを求める際には少数まで商を求めない)
F = min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
|
s526599327 | p03775 | u075012704 | 1490643377 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 287 | N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
if N%i == 0: #余りが0 = iは整数なので整数同士の割り算ということ(余りを求める際には少数まで商を求めない)
F = min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
|
s973176164 | p03775 | u075012704 | 1490643339 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 305 | N = int(input())
F = 999;
for i in range(1,int(sqrt(N))+1):
print(i)
if N%i == 0: #余りが0 = iは整数なので整数同士の割り算ということ(余りを求める際には少数まで商を求めない)
F = min(F , max( len(str(i)) , len(str(N//i)) ) )
print(F)
|
s009617648 | p03775 | u723654028 | 1490582548 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 151 | 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)
|
s901200311 | p03775 | u723654028 | 1490582508 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 262 | 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 = max(N // (10 ** (score - 1)), i+1)
"""
i += 1
print(score)
|
s555365210 | p03775 | u813098295 | 1490581366 | Python | Python (2.7.6) | py | Runtime Error | 34 | 2568 | 201 | N = int(raw_input())
t = 0
for i in xrange(1, N):
if i*i > N:
break
elif i*i == N:
t = i
break
if N % i == 0:
t = i
print max(len(str(t)), len(str(N/t))) |
s268146298 | p03775 | u581309643 | 1490580636 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 423 | def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n //= i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
N = int(input())
if N = 1:
print(1)
else:
table = prime_decomposition(N)
digN = len(str(N))
digMaxEle = len(str(table[-1]))
if digN / 2 < digMaxEle:
print(digMaxEle)
else:
print(digN//2 + digN%2)
|
s450700705 | p03775 | u581309643 | 1490580221 | Python | Python (3.4.3) | py | Runtime Error | 34 | 3060 | 366 | def prime_decomposition(n):
i = 2
table = []
while i * i <= n:
while n % i == 0:
n //= i
table.append(i)
i += 1
if n > 1:
table.append(n)
return table
N = int(input())
table = prime_decomposition(N)
digN = len(str(N))
digMaxEle = len(str(table[-1]))
if digN / 2 < digMaxEle:
print(digMaxEle)
else:
print(digN//2 + digN%2)
|
s255373558 | p03775 | u466826467 | 1490578936 | Python | Python (3.4.3) | py | Runtime Error | 30 | 2940 | 164 | import math
N = int(input())
for i in range(1, math.floor(math.sqrt(N))):
if N % i == 0:
factor = N / i
factor = int(factor)
print(len(str(factor)))
|
s442799713 | p03775 | u509661905 | 1490578452 | Python | Python (3.4.3) | py | Runtime Error | 46 | 3060 | 387 | #!/usr/bin/env python3
def div_pairs(n):
for i in range(1, n):
if i * i > n:
break
d, m = divmod(n, i)
if m == 0:
yield (i, d)
def f(a, b):
return max(len(str(a)), len(str(b)))
def solve(n):
return min(f(a, b) for a, b in div_pairs(n))
def main():
print(solve(int(input())))
if __name__ == '__main__':
main()
|
s248912459 | p03776 | u873059840 | 1599510832 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9168 | 526 | import math
N,A,B = map(int,input().split())
v = list(map(int,input().split()))
v.sort(reverse = True)
total = 0
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(A):
total = total + v[i]
else:
print(total / A)
count = 0
min = v[A-1]
number = v.count(min)
if(v.index(min) == 0):
for i in range(A,B+1):
count = combinations_count(number,i) + count
print(count)
else:
print(combinations_count(number,A - v.index(min)))
|
s312803005 | p03776 | u873059840 | 1599510321 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9212 | 522 | import math
N,A,B = map(int,input().split())
v = [map(int,input().split())]
v.sort(reverse = True)
total = 0
def combinations_count(n, r):
return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
for i in range(A):
total = total + v[i]
else:
print(total / A)
count = 0
min = v[A-1]
number = v.count(min)
if(v.index(min) == 0):
for i in range(A,B+1):
count = combinations_count(number,i) + count
print(count)
else:
print(combinations_count(number,A - v.index(min)))
|
s263850323 | p03776 | u572142121 | 1599498076 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9112 | 320 | N,A,B=map(int, input().split())
D=list(map(int, input().split()))
D=sorted(D)[::-1]
import math
from math import comb
print(sum(D[:A])/A)
ans=0
if D[0]==D[-1]:
n=D.count(D[A-1])
k=V[:A].count(D[A-1])
print(comb(n,k))
else:
ans=0
n=D.count(D[A-1])
for i in range(A,min(n,B)+1):
ans+=comb(n,i)
print(ans) |
s174489884 | p03776 | u572142121 | 1599496572 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9204 | 397 | N,A,B=map(int, input().split())
D=list(map(int, input().split()))
D=sorted(D)[::-1]
import math
import bisect
print(sum(D[:A])/A)
ans=0
if D==[D[0]]*N:
for i in range(A,B+1):
ans+=math.factorial(N)//(math.factorial(i)*math.factorial(N-i))
else:
a=D.count(D[a-1])
if a>1:
b=D[:A].count(D[a-1])
print(math.factorial(a)//(math.factorial(b)*math.factorial(a-b)))
else:
print(1) |
s289637047 | p03776 | u074220993 | 1599260571 | Python | Python (3.8.2) | py | Runtime Error | 55 | 10800 | 361 | N, A, B = map(int, input().split())
V = sorted([int(x) for x in input().split()],reverse=True)
from statistics import mean
from math import comb
maxmean = mean(V[:A])
way = 1
for i in range(1,B+1-A):
v = V.pop(0)
if v != maxmean:
break
if i > 0:
same = A + i
for j in range(A,same):
way += comb(same, j)
print(maxmean)
print(way) |
s223739078 | p03776 | u074220993 | 1597669934 | Python | Python (3.8.2) | py | Runtime Error | 41 | 10876 | 485 | import statistics
import math
N, A, B = map(int, input().split())
v = [int(x) for x in input().split()]
v.sort()
base = v[N-A:]
rem = v[:N-A]
mean_max = statistics.mean(base)
cnb = 0
while mean_max == statistics.mean(base):
if len(rem) == 0: break
same = base.count(base[0])
extra = rem.count(base[0])
cnb += math.factorial(same+extra)/math.factorial(same)/math.factorial(extra)
base.append(rem[len(rem)-1])
rem = rem.pop
print(mean_max)
print(math.floor(cnb)) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.