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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s272278988 | p03633 | u803647747 | 1533666039 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 278 | import math
N = int(input())
input_list = [int(input())for _ in range(N)]
def lcm(x, y):
return (x * y) // math.gcd(x, y)
initial_num = 1
for i in input_list:
if lcm(initial_num, i) > initial_num:
initial_num = lcm(initial_num, i)
print(initial_num) |
s043373552 | p03633 | u599547273 | 1533359450 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 185 | import fraction
def lcm(a, b):
return a * b // fraction.gcd(a, b)
n = int(input())
t = [int(input()) for i in range(n)]
ans = t[0]
for t_i in t[1:]:
ans = lcm(ans, t_i)
print(ans) |
s398397637 | p03633 | u599547273 | 1533359364 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 177 | import math
def lcm(a, b):
return a * b // math.gcd(a, b)
n = int(input())
t = [int(input()) for i in range(n)]
ans = t[0]
for t_i in t[1:]:
ans = lcm(ans, t_i)
print(ans) |
s662090103 | p03633 | u599547273 | 1533359130 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 185 | import math
def lcm(a, b):
return a * b // math.gcd(a, b)
n = int(input())
t = [int(input()) for i in range(n)]
t += [1, 1]
a = t.pop()
while t:
b = t.pop()
a = lcm(a, b)
print(a) |
s938539588 | p03633 | u599547273 | 1533359055 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 185 | import math
def lcm(a, b):
return a * b // math.gcd(a, b)
n = int(input())
t = [int(input()) for i in range(n)]
t += [1, 1]
a = t.pop()
while t:
b = t.pop()
a = lcm(a, b)
print(a) |
s928255287 | p03633 | u599547273 | 1533359022 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 182 | import math
def lcm(a, b):
return a * b // math.gcd(a, b)
n = int(input())
t = [int(input()) for i in range(n)]
t += [1]
a = t.pop()
while t:
b = t.pop()
a = lcm(a, b)
print(a) |
s722103622 | p03633 | u205561862 | 1533150326 | Python | Python (3.4.3) | py | Runtime Error | 45 | 5432 | 133 | import fractions
N = int(input())
T0 = 1
for i in range(N):
T1 = int(input())
T0 = int(T0*T1/fractions.gcd(T0,T1))
print(T0)
|
s778138105 | p03633 | u205561862 | 1533150240 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 131 | import fraction
N = int(input())
T0 = 1
for i in range(N):
T1 = int(input())
T0 = int(T0*T1/fraction.gcd(T0,T1))
print(T0)
|
s221846502 | p03633 | u205561862 | 1533150149 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 123 | import math
N = int(input())
T0 = 1
for i in range(N):
T1 = int(input())
T0 = int(T0*T1/math.gcd(T0,T1))
print(T0)
|
s270757735 | p03633 | u690536347 | 1533141712 | Python | Python (3.4.3) | py | Runtime Error | 47 | 5560 | 162 | from fractions import gcd
from functools import reduce
l = [int(input()) for _ in range(int(input()))]
o = reduce(lambda x, y: int(x * y / gcd(x, y)), l)
print(o) |
s675769487 | p03633 | u690536347 | 1533141388 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 149 | from functools import reduce
from fraction import gcd
l=[int(input()) for _ in range(int(input()))]
o=reduce(lambda x,y:int(x*y/gcd(x,y)),l)
print(o) |
s107166331 | p03633 | u690536347 | 1533141224 | Python | Python (3.4.3) | py | Runtime Error | 26 | 3812 | 145 | from functools import reduce
from math import gcd
l=[int(input()) for _ in range(int(input()))]
o=reduce(lambda x,y:int(x*y/gcd(x,y)),l)
print(o) |
s450378580 | p03633 | u200239931 | 1532917175 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5240 | 654 | import fractions
import math
from functools import reduce
def getinputdata():
# ι
εεζε
array_result = []
data = input()
array_result.append(data.split(" "))
flg = 1
try:
while flg:
data = input()
if(data != ""):
arra... |
s482786983 | p03633 | u858523893 | 1532700203 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 462 | N = int(input())
memo = {}
def mcd(a, b) :
if (a, b) in memo.keys() :
return memo[(a, b)]
else :
if max(a, b) % min(a, b) == 0 :
return min(a, b)
else :
memo[(a, b)] = mcd(min(a, b), max(a, b) % min(a, b))
return memo[(a, b)]
def lcm(a, b) :
retu... |
s768469397 | p03633 | u858523893 | 1532700012 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 373 | N = int(input())
t = [int(input()) for x in range(N)]
def mcd(a, b) :
if max(a, b) % min(a, b) == 0 :
return min(a, b)
else :
return mcd(min(a, b), max(a, b) % min(a, b))
def lcm(a, b) :
return int((a * b) / mcd(a, b))
t_s = sorted(t)
cur_lcm = t_s[0]
for i in range(1, len(t_s)) :
cu... |
s394635914 | p03633 | u858523893 | 1532546795 | Python | Python (3.4.3) | py | Runtime Error | 79 | 4040 | 415 | N = int(input())
t = [int(input()) for x in range(N)]
def lcm(a, b) :
if max(a, b) % min(a, b) == 0 :
return max(a, b)
else :
return a*b / gcd(a, b)
def gcd(a, b) :
if max(a, b) % min(a, b) == 0:
return min(a, b)
else :
return gcd(max(a, b) % min(a, b), min(a, b))
... |
s564608401 | p03633 | u348285568 | 1532207419 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 127 | import math
n=int(input())
ans=int(input())
for i in range(n-1):
a=int(input())
ans=(ans*a)//math.gcd(ans,a)
print(ans) |
s777797316 | p03633 | u348285568 | 1532207293 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 197 | import math
n=int(input())
ans=int(input())
for i in range(n-1):
a=int(input())
if max(a,ans)%min(a,ans)==0:
ans=max(ans,a)
else:
ans=(ans*a)//math.gcd(ans,a)
print(ans) |
s874590561 | p03633 | u403301154 | 1532140482 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3952 | 254 | n = int(input())
t = [int(input()) for i in range(n)]
def gcd(a, b):
if a<b:
a, b = b, a
if b==0:
return a
return gcd(b, a%b)
def lcm(a, b):
g = gcd(a, b)
return a/g*b
ans = 1
for i in range(n):
ans = lcm(ans, t[i])
print(int(ans)) |
s608794169 | p03633 | u403301154 | 1532140357 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4012 | 254 | n = int(input())
t = [int(input()) for i in range(n)]
def gcd(a, b):
if a<b:
a, b = b, a
if b==0:
return a
return gcd(b, a%b)
def lcm(a, b):
g = gcd(a, b)
return a*b/g
ans = 1
for i in range(n):
ans = lcm(ans, t[i])
print(int(ans)) |
s156465128 | p03633 | u403301154 | 1532140108 | Python | Python (3.4.3) | py | Runtime Error | 76 | 3952 | 233 | n = int(input())
t = [int(input()) for i in range(n)]
def gcd(a, b):
if a<b:
a, b = b, a
if b==0:
return a
return gcd(b, a%b)
l = t[0]*t[1]/gcd(t[0], t[1])
for i in range(2, n):
l = t[i]*l/gcd(t[i], l)
print(int(l)) |
s575532908 | p03633 | u982762220 | 1532023109 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 334 | N = int(input())
T = [int(input()) for _ in range(N)]
def gcd(A, B):
A, B = sorted([A, B], reverse=True)
prev_r = B
r = A % B
while r > 0:
prev_r = B
r = A % B
A, B = B, r
return prev_r
tmp = (T[0] * T[1]) // gcd(T[0], T[1])
for t in T[2:]:
tmp = (tmp * t) // gcd(tmp, t... |
s298454262 | p03633 | u982762220 | 1532022743 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 303 | N = int(input())
T = [int(input()) for _ in range(N)]
def gcd(A, B):
A, B = sorted([A, B], reverse=True)
r = A % B
while r > 0:
r = A % B
A, B = B, r
return max(B, 1)
tmp = (T[0] * T[1]) // gcd(T[0], T[1])
for t in T[2:]:
tmp = (tmp * t) // gcd(tmp, t)
print(tmp)
|
s905687682 | p03633 | u588341295 | 1531554062 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3696 | 320 | # -*- coding: utf-8 -*-
import math
from functools import reduce
N = int(input())
TN = [int(input()) for i in range(N)]
# γγγ―ζε°ε
¬εζ°γεΊγγγ°γγγ¨ζγ
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm_list(TN)) |
s310386002 | p03633 | u588341295 | 1531554012 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 328 | # -*- coding: utf-8 -*-
import fraction
from functools import reduce
N = int(input())
TN = [int(input()) for i in range(N)]
# γγγ―ζε°ε
¬εζ°γεΊγγγ°γγγ¨ζγ
def lcm_base(x, y):
return (x * y) // fraction.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm_list(TN)) |
s518547171 | p03633 | u050708958 | 1531428526 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3692 | 223 | import math
from functools import reduce
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
n = [int(input()) for _ in range(int(input()))]
print(lcm(*n))
|
s442784067 | p03633 | u085430333 | 1531199818 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 293 | import math
from operator import mul
from functools import reduce
def lcm(a, b):
a = int(a)
b = int(b)
return a * b / math.gcd(a, b)
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
ans = T[0]
for i in range(1, N):
ans = lcm(ans,T[i])
print(int(ans))
|
s654197429 | p03633 | u123756661 | 1531082667 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 101 | n=int(input())
ans=1
for i in range(n):
t=int(input())
print(t)
ans=lcm(ans,t)
print(ans) |
s519713116 | p03633 | u624475441 | 1530991813 | Python | Python (3.4.3) | py | Runtime Error | 197 | 3828 | 130 | import math
import functools
lcm=lambda x,y:x*y//math.gcd(x,y)
print(functools.reduce(lcm,[int(input())for _ in[0]*int(input())])) |
s921446349 | p03633 | u172773620 | 1530470728 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 212 | import math
def lcm(x, y):
return (x*y) // math.gcd(x, y)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
b = 1
for i in range(1, len(t)):
b = lcm(t[i-1],t[i])
print(b)
|
s261615486 | p03633 | u319410662 | 1530468987 | Python | Python (2.7.6) | py | Runtime Error | 23 | 3504 | 200 | def gcd(a, b):
m = max(a, b)
n = max(a, b)
if n==0:
return m
else:
return gcd(n, m%n)
N = int(input())
l = 1
for i in range(N):
t = int(input())
g = gcd(l, t)
l *= t//g
print(l) |
s965376078 | p03633 | u838194315 | 1530417140 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 343 | import math
import functools
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def gcd(A, B):
while(True):
if A and B:
if A > B:
A = A % B
else:
B = B % A
else:
return max(A, B)
def lcm(A, B):
return (A * // gcd(A, B)) * b
print(functools.reduce(lcm, so... |
s288952937 | p03633 | u415905784 | 1530415547 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 346 | import math
import functools
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def gcd(A, B):
while(True):
if A and B:
if A > B:
A = A % B
else:
B = B % A
else:
return max(A, B)
def lcm(A, B):
return int(A * (B / gcd(A, B)))
print(functools.reduce(lcm,... |
s644543117 | p03633 | u415905784 | 1530413009 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3572 | 342 | import math
import functools
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def gcd(A, B):
while(True):
if A and B:
if A > B:
A = A % B
else:
B = B % A
else:
return max(A, B)
def mcm(A, B):
return int(A * B / gcd(A, B))
print(functools.reduce(mcm, sor... |
s647754029 | p03633 | u731427834 | 1530211867 | Python | Python (3.4.3) | py | Runtime Error | 39 | 5308 | 207 | import fractions
def lcm(x, y):
return (x * y) // fractions.gcd(x, y)
N = int(input())
t1 = int(input())
t2 = int(input())
t = lcm(t1, t2)
for _ in range(2, N):
t = lcm(t, int(input()))
print(t)
|
s137957518 | p03633 | u136395536 | 1529844688 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 527 | N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort(reverse = True)
def GCD(a,b):
if a>=b:
bigger = a
smaller = b
else:
smaller = a
bigger = b
if smaller == 0:
return bigger
else:
return GCD(smaller, bigger%smaller)
def... |
s678780777 | p03633 | u267325300 | 1529769025 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3684 | 302 | from functools import reduce
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b):
if b > a:
b, a = a, b
return int(a * b / gcd(a, b))
x = reduce(lcm, T)
print(x)
|
s269594429 | p03633 | u267325300 | 1529768450 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 367 | N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b):
if a > b:
g = gcd(a, b)
return int(a / g * b)
else:
g = gcd(b, a)
return int(b / g * a)
x = T[0]
for i ... |
s932122512 | p03633 | u267325300 | 1529768348 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 333 | N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b):
if a > b:
g = gcd(a, b)
else:
g = gcd(b, a)
return int(a / g * b)
x = T[0]
for i in range(1, N):
x = lcm(x, T[i... |
s308886801 | p03633 | u267325300 | 1529701722 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3688 | 246 | import math
from functools import reduce
T = []
N = int(input())
for i in range(N):
T.append(int(input()))
def lcm(a, b):
g = math.gcd(a, b)
return int(a / g * b)
x = T[0]
for i in range(1, N):
x = lcm(x, T[i])
print(int(x))
|
s995056304 | p03633 | u482969053 | 1529408127 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 155 | import fraction
N = int(input())
T = [int(input()) for i in range(N)]
_lcm = 1
for T_i in T:
_lcm = _lcm * T_i // fraction.gcd(_lcm, T_i)
print(_lcm) |
s218950282 | p03633 | u482969053 | 1529408022 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 147 | import math
N = int(input())
T = [int(input()) for i in range(N)]
_lcm = 1
for T_i in T:
_lcm = _lcm * T_i // math.gcd(_lcm, T_i)
print(_lcm) |
s915905055 | p03633 | u698479721 | 1529382553 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 269 | N = int(input())
a = []
import fractions
for i in range(N):
a.append(int(input()))
def lcd(m,n):
c = fractions.gcd(m,n)
return m*n/c
def ans(li):
if len(li)=1:
return li[0]
else:
li[0]=lcd(li[0],li[1])
del li[1]
return ans(li)
print(ans(a))
|
s558364919 | p03633 | u828847847 | 1529174480 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 333 | def gcd(a,b):
if b == 0 :
return a
else :
return gcd(b,a%b)
def lcm(a,b):
return a*b/gcd(a,b)
n = int(input())
arr = []
for i in range(n):
arr.append(int(input()))
def mlcm():
if n = 1:
return arr[0]
ans = lcm(arr[0],arr[1])
i = 2
while i<n:
ans = lcm(ans,arr[i])
i+=1
return ans
... |
s646757801 | p03633 | u411858517 | 1529086653 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 238 | import math
from functools import reduce
N = int(input())
L = [ int(input()) for i in range(N)]
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm_list(L)) |
s848158840 | p03633 | u411858517 | 1529086453 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 181 | import math
from functools import reduce
N = int(input())
L = [ int(input()) for i in range(N)]
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm_list(L)) |
s415172931 | p03633 | u787562674 | 1528823428 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3692 | 291 | import math
from functools import reduce
N = int(input())
input_list = sorted([int(input()) for i in range(N)])
# ζε°ε
¬εζ°γζ±γγγ γ
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(*input_list)) |
s025062950 | p03633 | u787562674 | 1528823289 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 283 | import math
from functools import reduce
N = int(input())
input_list = [int(input()) for i in range(N)]
# ζε°ε
¬εζ°γζ±γγγ γ
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(*input_list)) |
s488059331 | p03633 | u001024152 | 1528209526 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 315 | N = int(input())
T = list((int(input()) for i in range(N)))
def gcd2(a, b):
if b == 0: return a
return gcd2(b, a%b)
def lcm2(a, b):
return int(a*b/gcd2(a, b))
def lcm(l):
while len(l) > 1:
tmp = lcm2(l.pop(), l.pop())
l.append(tmp)
return l[0]
print(lcm(T)) |
s749298232 | p03633 | u813450984 | 1528051497 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3700 | 224 | import math
from functools import reduce
n = int(input())
nums = [int(input()) for i in range(n)]
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(nums):
return reduce(lcm_base, nums, 1)
print(lcm(nums)) |
s247709353 | p03633 | u218843509 | 1527879955 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 137 | from fractions import gcd
n = int(input())
ans = 1
for _ in range(n):
i = int(input())
ans = int((ans / gcd(ans, i)) * i)
print(ans) |
s483882071 | p03633 | u218843509 | 1527879542 | Python | Python (3.4.3) | py | Runtime Error | 39 | 5432 | 135 | from fractions import gcd
n = int(input())
ans = 1
for _ in range(n):
i = int(input())
ans = int(ans / gcd(ans, i) * i)
print(ans) |
s319027012 | p03633 | u218843509 | 1527879512 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 135 | from fratcions import gcd
n = int(input())
ans = 1
for _ in range(n):
i = int(input())
ans = int(ans / gcd(ans, i) * i)
print(ans) |
s239738547 | p03633 | u218843509 | 1527879390 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 130 | from math import gcd
n = int(input())
ans = 1
for _ in range(n):
i = int(input())
ans = int(ans * i / gcd(ans, i))
print(ans) |
s319141372 | p03633 | u218843509 | 1527879377 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5304 | 135 | from fractions import gcd
n = int(input())
ans = 1
for _ in range(n):
i = int(input())
ans = int(ans * i / gcd(ans, i))
print(ans) |
s743413596 | p03633 | u597436499 | 1527377913 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 342 | import sys
stdin = sys.stdin
n = int(stdin.readline())
t = [0]*n
for i in range(n):
t[i] = int(stdin.readline())
max = max(t)
ok = 0
while max <= 10**18:
for i in t:
if max % i == 0:
ok += 1
else:
break
if ok == n:
t_max = max
break
max *= 2
... |
s444307668 | p03633 | u597436499 | 1527377799 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 341 | import sys
stdin = sys.stdin
n = int(stdin.readline())
t = [0]*n
for i in range(n):
t[i] = int(stdin.readline())
max = max(t)
ok = 0
while max < 10**18:
for i in t:
if max % i == 0:
ok += 1
else:
break
if ok == n:
t_max = max
break
max *= 2
... |
s787365478 | p03633 | u635931083 | 1527196001 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 329 | def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm_base(x, y):
return (x * y) // gcd(x, y)
def lcm_list(numbers):
ans = lcm_base(numbers[0], numbers[1])
for x in numbers:
ans = lcm_base(ans, x)
return ans
n = int(input())
t = [int(input()) for i in range(n)]
result = lcm_list(t)
print... |
s878572957 | p03633 | u635931083 | 1527195048 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3692 | 253 | import math
from functools import reduce
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
n = int(input())
t = [int(input()) for i in range(n)]
result = lcm_list(t)
print(result) |
s469255887 | p03633 | u828847847 | 1526668035 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 294 | def gcd(a,b):
if b == 0 :
return a
else :
return gcd(b,a%b)
def lcm(a,b):
return a*b/gcd(a,b)
n = int(input())
arr = []
for i in range(n):
arr.append(int(input()))
def mlcm():
ans = lcm(arr[0],arr[1])
i = 2
while i<n:
ans = lcm(ans,arr[i])
i+=1
return ans
print mlcm()
|
s054256244 | p03633 | u681340020 | 1526663405 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5176 | 306 | import fractions
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a * b / fractions.gcd(a, b)
n = int(input())
ans = 1
for i in range(n):
ti = int(input())
ans = int(lcm(ti, ans))
while True:
try:
input()
except EOFError:
break
print(ans)
|
s517262105 | p03633 | u681340020 | 1526657892 | Python | Python (3.4.3) | py | Runtime Error | 39 | 5304 | 234 | import fractions
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a * b / fractions.gcd(a, b)
n = int(input())
ans = 1
for i in range(n):
ti = int(input())
ans = int(lcm(ti, ans))
print(ans)
|
s149002027 | p03633 | u681340020 | 1526657719 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 366 | def gcd(a,b):
"""Compute the greatest common divisor of a and b"""
if b > a:
a, b = b, a
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a * b / gcd(a, b)
n = int(input())
ans = 1
for i in range(n):
ti = int(in... |
s418338886 | p03633 | u681340020 | 1526656946 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 332 | def gcd(a,b):
"""Compute the greatest common divisor of a and b"""
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
"""Compute the lowest common multiple of a and b"""
return a * b / gcd(a, b)
n = int(input())
ans = 1
for i in range(n):
ti = int(input())
ans = int(lcm(ti, ans))... |
s519411535 | p03633 | u118642796 | 1526247370 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 150 | import math
N = int(input())
T = []
[T.append(int(input())) for _ in range(N)]
ans = 1
for t in T:
ans = ans * t // math.gcd(ans,t)
print(ans) |
s918685447 | p03633 | u856232850 | 1525829784 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 239 | def gcd(x,y):
while y != 0:
x , y = y , x % y
return x
def lcm(x,y):
return int(x*y/gcd(x,y))
n = int(input())
a =[]
for i in range(n):
a.append(int(input()))
for i in range(n-1):
a[i+1] = lcm(a[i],a[i+1])
print(a[-1]) |
s333108506 | p03633 | u783232909 | 1525390408 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 565 | #!/usr/bin/env python
from functools import reduce
import math
# GCD and LCM are not in math module. They are in gmpy, but these are simple enough:
# def gcd(a,b):
# """Compute the greatest common divisor of a and b"""
# while b > 0:
# a, b = b, a % b
# return a
def lcm(a, b):
"""Comput... |
s091284292 | p03633 | u783232909 | 1525389924 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 501 | #!/usr/bin/env python
from functools import reduce
import math
# GCD and LCM are not in math module. They are in gmpy, but these are simple enough:
# def gcd(a,b):
# """Compute the greatest common divisor of a and b"""
# while b > 0:
# a, b = b, a % b
# return a
def lcm(a, b):
"""Comput... |
s883305096 | p03633 | u783232909 | 1525389844 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 505 | #!/usr/bin/env python
from functools import reduce
import math
# GCD and LCM are not in math module. They are in gmpy, but these are simple enough:
# def gcd(a,b):
# """Compute the greatest common divisor of a and b"""
# while b > 0:
# a, b = b, a % b
# return a
def lcm(a, b):
"""Comput... |
s831606910 | p03633 | u783232909 | 1525389492 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 478 | #!/usr/bin/env python
from functools import reduce
# GCD and LCM are not in math module. They are in gmpy, but these are simple enough:
def gcd(a,b):
"""Compute the greatest common divisor of a and b"""
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
"""Compute the lowest common mu... |
s244775786 | p03633 | u620084012 | 1524851661 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 299 | def gcd(a,b):
if a<b:
t = a
a = b
b = t
if b == 0:
return a
t = b
b = a%b
a = t
return gcd(a,b)
def lcm(a,b):
return a*b/gcd(a,b)
N = int(input())
ans = int(input())
for k in range(N-1):
ans = int(lcm(ans, int(input())))
print(ans)
|
s483777783 | p03633 | u620868411 | 1524833080 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3944 | 233 | # -*- coding: utf-8 -*-
n = int(input())
def gcd(a, b):
if b==0:
return a
return gcd(b, a%b)
def lcm(a,b):
return a/gcd(a,b)*b
ans = 1
for _ in range(n):
t = int(input())
ans = lcm(ans, t)
print(ans)
|
s733414317 | p03633 | u620868411 | 1524832700 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3948 | 233 | # -*- coding: utf-8 -*-
n = int(input())
def gcd(a, b):
if b==0:
return a
return gcd(b, a%b)
def lcm(a,b):
return a*b/gcd(a,b)
ans = 1
for _ in range(n):
t = int(input())
ans = lcm(ans, t)
print(ans)
|
s218357305 | p03633 | u620868411 | 1524832222 | Python | Python (3.4.3) | py | Runtime Error | 76 | 4072 | 401 | # -*- coding: utf-8 -*-
n = int(input())
t = []
for _ in range(n):
t.append(int(input()))
def gcd(a, b):
if b==0:
return a
return gcd(b, a%b)
def lcm(a,b):
return a*b/gcd(a,b)
def lcmary(x, t):
if len(t)==0:
return x
elif len(t)==1:
return lcm(x,t[0])
else:
... |
s723270802 | p03633 | u620868411 | 1524831912 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3960 | 401 | # -*- coding: utf-8 -*-
n = int(input())
t = []
for _ in range(n):
t.append(int(input()))
def gcd(a, b):
if b==0:
return a
return gcd(b, a%b)
def lcm(a,b):
return a*b/gcd(a,b)
def lcmary(x, t):
if len(t)==0:
return x
elif len(t)==1:
return lcm(x,t[0])
else:
... |
s212193651 | p03633 | u503901534 | 1524631756 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 368 | n = int(input())
tt = []
for i in range(n):
tt.append(int(input()))
ss = int(1)
for i in tt:
p = []
p.append(int(ss))
p.append(int(i))
q = list(sorted(p))
while q[1] % q[0] != 0:
r = [q[1] % q[0] , q[0]]
s = list(sorted(r))
q[0] = int(s[0])
q[1] = int(s[1])
... |
s099873769 | p03633 | u503901534 | 1524631154 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 373 | n = int(input())
tt = []
for i in range(n):
tt.append(int(input()))
ss = int(1)
for i in tt:
p = []
p.append(int(ss))
p.append(int(i))
q = list(sorted(p))
while q[1] % q[0] != 0:
r = [q[1] % q[0] , q[0]]
s = list(sorted(r))
q[0] = int(s[0])
q[1] = int(s[1])
... |
s675877142 | p03633 | u503901534 | 1524631069 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 353 | n = int(input())
tt = []
for i in range(n):
tt.append(int(input()))
ss = int(1)
for i in tt:
p = []
p.append(ss)
p.append(i)
q = list(sorted(p))
while q[1] % q[0] != 0:
r = [q[1] % q[0] , q[0]]
s = list(sorted(r))
q[0] = s[0]
q[1] = s[1]
ss = i... |
s477492991 | p03633 | u503901534 | 1524631027 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 369 | n = int(input())
tt = []
for i in range(n):
tt.append(int(input()))
ss = int(1)
for i in tt:
p = []
p.append(ss)
p.append(i)
q = list(sorted(p))
while q[1] % q[0] != 0:
r = [q[1] % q[0] , q[0]]
s = list(sorted(r))
q[0] = s[0]
q[1] = s[1]
print(q)
... |
s768392302 | p03633 | u281303342 | 1524061531 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 171 | from math import gcd
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
Ans = T[0]
for i in range(1,N):
Ans = Ans*T[i]//gcd(Ans,T[i])
print(Ans) |
s095528213 | p03633 | u559823804 | 1523764947 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3692 | 318 | import math
import functools
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return functools.reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
return functools.reduce(lcm_base, numbers, 1)
n=int(input())
t=[]
for i in range(n):
t.append(int(input()))
print(lcm_list(t))
|
s360170383 | p03633 | u553348533 | 1522791670 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 237 | N = int(input())
listClock = [int(input()) for i in range(N)]
def gcd(x, y):
while y > 0:
x, y = y, x%y
return x
def lcm(x, y):
return x/gcd(x, y)*y
ans = 1
for i in listClock:
ans = int(lcm(ans,i))
print(ans) |
s003398969 | p03633 | u553348533 | 1522025039 | Python | Python (3.4.3) | py | Runtime Error | 240 | 4212 | 246 | import math
from functools import reduce
N = int(input())
listClock = [int(input()) for i in range(N)]
def retLCM_base(a,b):
return (a * b) // math.gcd(a, b)
def retLCM(*Num):
return reduce(retLCM_base, Num, 1)
print(retLCM(*listClock)) |
s593150730 | p03633 | u064408584 | 1521910747 | Python | Python (3.4.3) | py | Runtime Error | 47 | 5560 | 103 | import fractions
t=1
for i in range(int(input())):
s=int(input())
t=t*s//math.gcd(s,t)
print(t) |
s136326231 | p03633 | u064408584 | 1521910686 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 98 | import math
t=1
for i in range(int(input())):
s=int(input())
t=t*s//math.gcd(s,t)
print(t) |
s532354956 | p03633 | u429843511 | 1521725893 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 337 | import functools
import math
def gcd(x,y):
a,b = max(x,y), min(x,y)
while a % b != 0:
a,b = b,a%b
return b
def lcm2(x,y):
return int(x*y / gcd(x,y))
N = int(input())
T = []
for i in range(N):
ti = int(input())
T.append(ti)
result = 1
for t in T:
result = lcm2(result, t)
pri... |
s975320990 | p03633 | u429843511 | 1521724090 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 353 | import functools
import math
def gcd(x,y):
a,b = max(x,y), min(x,y)
while a % b != 0:
a,b = b,a%b
return b
def lcm2(x,y):
return int(x*y / gcd(x,y))
def lcm_lot(nums):
return functools.reduce(lcm2, nums, 1)
N = int(input())
T = []
for i in range(N):
ti = int(input())
T.appe... |
s861360119 | p03633 | u429843511 | 1521723073 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 241 | import functools
import math
def lcm2(x,y):
return x*y // math.gcd(x,y)
def lcm_lot(nums):
return functools.reduce(lcm2, nums, 1)
N = int(input())
T = []
for i in range(N):
ti = int(input())
T.append(ti)
print(lcm_lot(T)) |
s870284733 | p03633 | u498401785 | 1520568723 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 253 | def gcd(a, b):
if(b == 0):
return a
return gcd(b, a % b)
n = int(input())
prev = 0
for i in range(n):
if(i == 0):
prev = int(input())
else:
t = int(input())
prev = int(prev * t / gcd(prev, t))
print(prev)
|
s716662381 | p03633 | u498401785 | 1520568474 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 197 | import math
n = int(input())
prev = 0
for i in range(n):
if(i == 0):
prev = int(input())
else:
t = int(input())
prev = int(prev * t / math.gcd(prev, t))
print(prev)
|
s655313940 | p03633 | u498401785 | 1520568397 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 193 | import math
n = int(input())
prev = 0
for i in range(n):
if(i == 0):
prev = int(input())
else:
t = int(input())
prev = prev * t // math.gcd(prev, t)
print(prev)
|
s313382324 | p03633 | u668726177 | 1520568041 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 691 | #include <algorithm>
#include <iostream>
#include <set>
#include <vector>
#include <cmath>
#include <utility>
#include <numeric>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
#define all(a) (a).begin(), (a).end()
#define rep(i, n) for (int i=0;(i)<(n);(i)++)
#defi... |
s049564805 | p03633 | u499259667 | 1516995678 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3944 | 253 | def koubai(a,b):
if b==0:
return a
return(koubai(b,a%b))
def kouyaku(a,b):
return a*b/koubai(a,b)
N=int(input())
if N==1:
print(int(input()))
exit()
ans=1
for i in range(N):
ans=kouyaku(ans,int(input()))
print(int(ans))
|
s276758704 | p03633 | u499259667 | 1516995521 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3944 | 242 | def koubai(a,b):
if b==0:
return a
return(koubai(b,a%b))
def kouyaku(a,b):
return a*b/koubai(a,b)
N=int(input())
if N==1:
print(int(input()))
ans=1
for i in range(N):
ans=kouyaku(ans,int(input()))
print(int(ans))
|
s997237243 | p03633 | u499259667 | 1516995479 | Python | PyPy3 (2.4.0) | py | Runtime Error | 334 | 51568 | 242 | def koubai(a,b):
if b==0:
return a
return(koubai(b,a%b))
def kouyaku(a,b):
return a*b/koubai(a,b)
N=int(input())
if N==1:
print(int(input()))
ans=1
for i in range(N):
ans=kouyaku(ans,int(input()))
print(int(ans))
|
s208453522 | p03633 | u499259667 | 1516995337 | Python | PyPy3 (2.4.0) | py | Runtime Error | 327 | 51696 | 217 | def koubai(a,b):
if b==0:
return a
return(koubai(b,a%b))
def kouyaku(a,b):
return a*b/koubai(a,b)
N=int(input())
ans=1
T=[0]*N
for i in range(N):
ans=kouyaku(ans,int(input()))
print(int(ans))
|
s479033368 | p03633 | u521992338 | 1515565226 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 245 | def gcd(a, b):
if (a % b == 0):
return b
else:
return gcd(b, a%b)
def lcm(a, b):
return int(a / gcd(a, b)) * b
n = int(input())
time = 1
for i in range(n):
t = int(input())
time = lcm(time, t)
print (time) |
s133219326 | p03633 | u521992338 | 1515565046 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 241 | def gcd(a, b):
if (a % b == 0):
return b
else:
return gcd(b, a%b)
def lcm(a, b):
return int(a*b/gcd(a, b))
n = int(input())
time = 1
for i in range(n):
t = int(input())
time = lcm(time, t)
print (time) |
s643474755 | p03633 | u521992338 | 1515564815 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 291 | def gcd(a, b):
if (a % b == 0):
return b
else:
return gcd(b, a%b)
def lcm(a, b):
return int(a*b/gcd(a, b))
n = int(input())
t_list = []
for i in range(n):
t_list.append(int(input()))
time = 1
for i in range(n):
time = lcm(time, t_list[i])
print (time) |
s932489500 | p03633 | u353919145 | 1515191172 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 288 | # -*- coding: utf-8 -*-
import sys
import collections
import math
# code start
def lcm(a,b):
return a*b/math.gcd(int(a),int(b))
def main():
count = int(input())
i = 0
temp = 1
while(i<count):
i+=1
num = int(input())
temp = lcm(temp,num)
print(int(temp))
main()
# code end
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.