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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s918675620 | p03633 | u216289806 | 1502817718 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 325 | import gcc
def gcd(a,b):
if a<b:
c=a;
a=b;
b=c;
c=a%b
if c==0:
return b
else:
return gcc.gcd(b,c)
def lcm(a,b):
c=gcd(a,b);
return a/c*b
n=int(input())
t=[int(input()) for lop in range(n)]
ans=t[0]
for lop in range(1,n):
ans=lcm(ans,t)
print(int(... |
s860191128 | p03633 | u216289806 | 1502817252 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 229 | def gcd(a,b):
return b
def lcm(a,b):
c=gcd(a,b);
return a
N=input()
n=int(N)
ANS=input()
ans=int(ANS)
for lop in range(n):
T=input()
t=int(T)
ans=lcm(ans,t)
print(int(ans))
print('\n')
quit()
|
s773285224 | p03633 | u216289806 | 1502815810 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3952 | 345 | def gcd(a,b):
if a<b:
c=a;
a=b;
b=c;
c=a%b
if c==0:
return b
else:
return gcd(b,c)
def lcm(a,b):
c=gcd(a,b);
return a/c*b
N=input()
n=int(N)
ANS=input()
ans=int(ANS)
for lop in range(n-1):
T=input()
t=int(T)
ans=lcm(ans,t)
print(int(... |
s543247851 | p03633 | u754217932 | 1502747250 | Python | Python (3.4.3) | py | Runtime Error | 71 | 3948 | 217 | 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())
ans = 1
for i in range(n):
ans = lcm(ans,int(input()))
print (int(ans))
|
s780814760 | p03633 | u754217932 | 1502746843 | Python | Python (3.4.3) | py | Runtime Error | 73 | 4080 | 267 | 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())
t = [int(input())]
for i in range(1,n):
t.append(int(input()))
ans = 1
for i in t:
ans = lcm(i,ans)
print(int(ans))
|
s334693408 | p03633 | u781091740 | 1502737226 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 107 | import math;n=int(input());g=int(input())
for i in range(n-1):t=int(input());g=g*t//math.gcd(g,t)
print(g)
|
s586614448 | p03633 | u793383875 | 1502689721 | Python | Python (3.4.3) | py | Runtime Error | 71 | 3956 | 311 | def gsd(a,b):
if b==0:
return a
else:
return gsd(b,a%b)
n=int(input())
a=[0]*100
for x in range(0,n):
a[x]=int(input())
if n==1:
print(a[0])
else:
k=gsd(a[0],a[1])
k=a[0]*a[1]/k
for x in range(2,n):
f=k
k=gsd(k,a[x])
k=a[x]*f/k
k=round(k)
print(k) |
s275677712 | p03633 | u650245944 | 1502673731 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 217 | N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
for i in T:
k = 1
if ans // i < 1:
k = i // ans
for j in range(k, i+1, l):
if ans * j % i == 0:
ans = ans * j
break
print(ans) |
s796184251 | p03633 | u676264453 | 1502634539 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 280 | from functools import reduce
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b / gcd(a,b)
N = int(input())
Ts = []
for i in range(N):
Ts.append(int(input()))
c = 1
for T in Ts:
c = lcm(c, T)
print(int(c))
|
s379575482 | p03633 | u194412908 | 1502629387 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38512 | 231 | import math
import functools
def lcm(a,b):
return a*b/math.gcd(a,b)
n=int(input())
t=[int(input()) for i in range(n)]
if n==1:
print(t[0])
else:
anser=1
for i in t:
anser=lcm(anser,i)
print(anser) |
s365564454 | p03633 | u194412908 | 1502629353 | Python | PyPy3 (2.4.0) | py | Runtime Error | 163 | 38256 | 236 | import math
import functools
def lcm(a,b):
return int(a*b/math.gcd(a,b))
n=int(input())
t=[int(input()) for i in range(n)]
if n==1:
print(t[0])
else:
anser=1
for i in t:
anser=lcm(anser,i)
print(anser) |
s460482042 | p03633 | u194412908 | 1502629129 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3572 | 199 | import math
import functools
def lcm(a,b):
return int(a*b/math.gcd(a,b))
n=int(input())
t=[int(input()) for i in range(n)]
if n==1:
print(t[0])
else:
print(functools.reduce(lcm,t)) |
s314790203 | p03633 | u194412908 | 1502629075 | Python | PyPy3 (2.4.0) | py | Runtime Error | 194 | 40432 | 199 | import math
import functools
def lcm(a,b):
return int(a*b/math.gcd(a,b))
n=int(input())
t=[int(input()) for i in range(n)]
if n==1:
print(t[0])
else:
print(functools.reduce(lcm,t)) |
s692170330 | p03633 | u443170850 | 1502628882 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 544 | N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = 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 solve(listT):
listlen = len(listT)
ans = -1
while True:
ans = lcm(listT[listlen - 2],... |
s858489028 | p03633 | u194412908 | 1502628727 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38640 | 165 | import math
import functools
def lcm(a,b):
return int(a*b/math.gcd(a,b))
N=int(input())
t=[int(input()) for i in range(N)]
print(functools.reduce(lcm,t)) |
s852571534 | p03633 | u966695411 | 1502628547 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3444 | 842 | #! /usr/bin/env python3
def f(diu, n):
r = []
try:
while n != 1:
r = [diu[n][0]] + r
n = diu[n][1]
except:
pass
return r
memo = {}
def d(p, a, b, k):
if k in memo : return memo[k]
c = 0
for i, j in zip(a, b):
if i == j:
c += 1
... |
s301031098 | p03633 | u443170850 | 1502628477 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 576 | N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = int(input())
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):
return a * b // gcd(a, b)
def solve(listT):
listlen = len(listT)
ans = -1
while True:
... |
s609100246 | p03633 | u782330257 | 1502614153 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 138 | from math import *
def lcm(a,b):
return (a*b)//gcd(a,b)
ans=1
for _ in range(int(input())):
ans=lcm(ans,int(input()))
print(ans) |
s368979812 | p03633 | u782330257 | 1502613854 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 138 | from math import *
def lcm(a,b):
return (a*b)//gcd(a,b)
ans=1
for _ in range(int(input())):
ans=lcm(ans,int(input()))
print(ans) |
s809363828 | p03633 | u803848678 | 1502606523 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 347 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
else:
return int(gcd(b, a%b))
def lcm(a, b):
return int(a // gcd(a, b) * b)
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T)... |
s667858727 | p03633 | u119460590 | 1502605303 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 271 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
else:
return int(gcd(b, a%b))
def lcm(a, b):
return int(a / gcd(a, b) * b)
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T))
print("%d" % V) |
s819597936 | p03633 | u119460590 | 1502605190 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3948 | 261 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
else:
return gcd(b, a%b)
def lcm(a, b):
return a / gcd(a, b) * b
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T))
print("%d" % V) |
s009433470 | p03633 | u119460590 | 1502604321 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3948 | 263 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
else:
return gcd(b, a%b)
def lcm(a, b):
return a * b / gcd(a, b)
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T))
print(int(V)) |
s590108125 | p03633 | u119460590 | 1502604265 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3948 | 261 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
else:
return gcd(b, a%b);
def lcm(a, b):
return a * b / gcd(a, b);
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T));
print(int(V)) |
s586789714 | p03633 | u119460590 | 1502604186 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3056 | 261 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
else:
return gcd(b, a%b);
def lcm(a, b):
return int(a * b / gcd(a, b));
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T));
print(V) |
s982239715 | p03633 | u119460590 | 1502604010 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 227 | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a%b);
def lcm(a, b):
return int(a * b / gcd(a, b));
N = input()
V = 1
for i in range(int(N)):
T = input()
V = lcm(V, int(T));
print(V) |
s682577880 | p03633 | u069868485 | 1502603561 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3940 | 186 | def uq(a,c):
return c if a%c==0 else uq(c,a%c)
n=(int)(input())
result = 1
for j in range(0,n):
f=(int)(input())
result=((result/uq(result,f)))*f
print((int)(result)) |
s142252202 | p03633 | u069868485 | 1502603410 | Python | Python (3.4.3) | py | Runtime Error | 71 | 3936 | 186 | def uq(a,c):
return c if a%c==0 else uq(c,a%c)
n=(int)(input())
result = 1
for j in range(0,n):
f=(int)(input())
result=((result*f/uq(result,f)))
print((int)(result)) |
s488118370 | p03633 | u069868485 | 1502602465 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 210 | def uq(a,c):
return c if a%c==0 else uq(c,a%c)
n=(int)(input())
T=[]
for i in range(0,n):
T.append((int)(input()))
result = 1
for j in T:
result=(int)((result*j)/uq(result,j))
print(result) |
s511433885 | p03633 | u250000175 | 1502601055 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 329 | n = int(input())
t_list = []
max = 0
for i in range(n):
t = int(input())
if t > max:
max = t
else:
t_list.append(t)
times = 0
is_not_divisible = True
while is_not_divisible:
times += 1
for t in t_list:
if (max*times)%t != 0:
is_not_divisible = True
break
else:
is_not_divisible = False
print(m... |
s352864872 | p03633 | u250000175 | 1502598127 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 303 | n = int(input())
t_list = []
for i in range(n):
t_list.append(int(input())
t_max = max(t_list)
times = 0
is_not_divisible = True
while is_not_divisible:
times += 1
for t in t_list:
if (t_max*times)%t != 0:
is_not_divisible = True
break
else:
is_not_divisible = False
print(t_max*times) |
s356530330 | p03633 | u341087021 | 1502596666 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5432 | 172 | from fractions import gcd
n = int(input())
l = []
for i in range(n):
t = int(input())
l.append(t)
g = reduce(gcd, l)
c = g.copy
for x in l:
c = c * (x/g)
print(c) |
s221453911 | p03633 | u467508794 | 1502595954 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 164 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
n = int(input())
a = [int(input()) for i in range(n)]
r = 1
for i in a:
r = lcm(r, i)
print(r) |
s522176246 | p03633 | u575074893 | 1502595872 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 210 | import math
def lcm (a, b):
return a // math.gcd (a, b) * b
n, ts = int(input()), []
for i in range (n):
ts.append (int (input ()))
ans = 1
for i in range (n):
ans = lcm (ans, ts[i])
print (ans) |
s685597497 | p03633 | u875361824 | 1502595862 | Python | Python (3.4.3) | py | Runtime Error | 76 | 3940 | 467 | def main():
N = int(input().strip())
res = int(input().strip())
if N == 1:
print(res)
return
for _ in range(1, N):
t = int(input().strip())
res = lcm(res, t)
print(res)
def lcm(a, b):
return (a * b) / gcd(a, b)
def gcd(a, b):
if b == 0:
return a
... |
s008461441 | p03633 | u467508794 | 1502594865 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3572 | 163 | import math
import functools
def lcm(x, y):
return (x * y) // math.gcd(x, y)
n = int(input())
print(functools.reduce(lcm, [int(input()) for i in range(n)]))
|
s393841464 | p03633 | u741323288 | 1502594520 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3980 | 365 | #accepted
def gcd(x,y):
while y != 0:
temp = x%y
x = y
y = temp
return x
def lcmiter(array):
if len(array) == 2:
x = array[1]
y = array[0]
return x*y/gcd(x,y)
else:
x = lcmiter(array[1:])
y = array[0]
return x*y/gcd(x,y)
N = int(input())
t = []
for i in range(N):
new_n= int(input())
t.appen... |
s631018285 | p03633 | u690342431 | 1502594447 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 186 | from math import gcd
from functools import reduce
def lcm(a, b):
return a*b // gcd(a, b)
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
print(reduce(lcm, T)) |
s594280866 | p03633 | u473999868 | 1502594245 | Python | Python (3.4.3) | py | Runtime Error | 28 | 3828 | 273 | import math as m
from functools import reduce
n,T= int(input()),[]
def f(a, b):
return int(a * b // m.gcd(a, b))
for i in range(n):
T.append(int(input()))
tmp = max(T)
for i in range(n):
if tmp % T[i] != 0:
tmp = T[i]//m.gcd(tmp, T[i])*tmp
print(tmp)
|
s444128161 | p03633 | u473999868 | 1502594153 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3688 | 213 | import math as m
from functools import reduce
n,l= int(input()),[]
def f(a, b):
return int(a * b // m.gcd(a, b))
for i in range(n):
l.append(int(input()))
print(reduce( lambda x,y: y//m.gcd(x,y)*x, l))
|
s157209619 | p03633 | u473999868 | 1502593873 | Python | Python (3.4.3) | py | Runtime Error | 33 | 4212 | 194 | import math as m
from functools import reduce
n = int(input())
l = []
def f(a, b):
return int(a * b // m.gcd(a, b))
for i in range(n):
l.append(int(input()))
print(reduce(f, l))
|
s988960940 | p03633 | u294283114 | 1502593845 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 226 | import math
def lcm(x, y):
return ((x * y) // math.gcd(x, y))
n = int(input())
t = [i for i in range(n)]
for i in range(n):
t[i] = int(input())
ans = 1
for i in range(0, n):
ans = lcm(ans, t[i])
print(int(ans)) |
s912981596 | p03633 | u473999868 | 1502593843 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3572 | 194 | import math as m
from functools import reduce
n = int(input())
l = []
def f(a, b):
return int(a * b / m.gcd(a, b))
for i in range(n):
l.append(int(input()))
print(reduce(f, l))
|
s428788837 | p03633 | u294283114 | 1502593415 | Python | Python (3.4.3) | py | Runtime Error | 22 | 3316 | 234 | import math
def lcm(x, y):
return (int(x * y) // int(math.gcd(x, y)))
n = int(input())
t = [i for i in range(n)]
for i in range(n):
t[i] = int(input())
ans = 1
for i in range(0, n):
ans = lcm(ans, t[i])
print(int(ans)) |
s183476579 | p03633 | u294283114 | 1502593375 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 233 | import math
def lcm(x, y):
return int(x * y) // int(math.gcd(x, y)))
n = int(input())
t = [i for i in range(n)]
for i in range(n):
t[i] = int(input())
ans = 1
for i in range(0, n):
ans = lcm(ans, t[i])
print(int(ans)) |
s160453987 | p03633 | u294283114 | 1502593343 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 231 | import math
def lcm(x, y):
return int(x * y) // math.gcd(x, y))
n = int(input())
t = [i for i in range(n)]
for i in range(n):
t[i] = int(input())
ans = t[0]
for i in range(1, n):
ans = lcm(ans, t[i])
print(int(ans)) |
s430371097 | p03633 | u346308892 | 1502592825 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3956 | 389 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if n==0:
return m
r=m%n
if r == 0:
return n
return gcd(n,r)
def lcm(m,n):
g=gcd(m,n)
return (m/g)*n
x=[]
N=int(input())
for i in range(N):
x.append(int(input()))
l=x[0]
for k in range(0,len(x))... |
s367993296 | p03633 | u346308892 | 1502592713 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 376 |
def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if n==0:
return m
r=m%n
if r == 0:
return n
return gcd(n,r)
def lcm(m,n):
return (m/g)*n
x=[]
N=int(input())
for i in range(N):
x.append(int(input()))
l=x[0]
for k in range(0,len(x)):
#print(l... |
s930730012 | p03633 | u087279476 | 1502592526 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 706 | def lcm(a, b):
ax = a
bx = b
c = 0
if a<b:
ax, bx = (bx, ax)
while True:
if ax%bx == 0:
gcd = bx
break
else:
c = bx
bx = ax%bx
ax = c
return a*b // gcd
n = int(input())
lst = []
lst2 = []
for i in range(n):
... |
s491872275 | p03633 | u346308892 | 1502591983 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3952 | 529 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def lcm(m,n):
if m<n:
return lcm(n,m)
if m==n:
return m
if m%n==0:
return m
g=gcd(m,n)
if g==1:
... |
s052518235 | p03633 | u792078574 | 1502591977 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 273 | N = int(raw_input())
ts = []
for n in xrange(N):
ts.append(int(raw_input()))
ts.sort(reverse=True)
for i in xrange(len(ts)-1):
a = ts[i] * ts[i+1]
b = ts[i] - ts[i+1]
while a % b != 0:
r = a % b
a = b
b = r
ts[i+1] = ts[i] * ts[i+1] / b
print ts[-1] |
s303335531 | p03633 | u087279476 | 1502591932 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 801 | def lcm(a, b):
ax = a
bx = b
c = 0
if a<b:
ax, bx = (bx, ax)
while True:
if ax%bx == 0:
gcd = bx
break
else:
c = bx
bx = ax%bx
ax = c
return a*b // gcd
n = int(input())
Mx = int(input())
lst = [Mx]
lst2 = []
for... |
s089616370 | p03633 | u768816323 | 1502591659 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 312 | # your code goes here
def gcd(a,b):
if b>a:
t=b
b=a
a=t
a1=a
b1=b
while b1>0:
r=a1%b1
a1=b1
b1=r
a//=a1
a*=b
return a
N=int(input())
T=[int(input()) for i in range(N)]
m=gcd(T[0],T[1])
i=2
while i <N:
m=gcd(m,T[i])
i+=1
print(m) |
s726692807 | p03633 | u868040597 | 1502591653 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 439 | # coding: utf-8
n = int(input())
t = sorted([int(input()) for i in range(n)])
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def nlcm(list):
if len(list) > 2:
lcm_num = lcm(list[0], list[1])
for i in range(2, len(list)):
lcm_num = lcm(lcm_num, l... |
s669962783 | p03633 | u868040597 | 1502591582 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 439 | # coding: utf-8
n = int(input())
t = sorted([int(input()) for i in range(n)])
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def nlcm(list):
if len(list) > 2:
lcm_num = lcm(list[0], list[1])
for i in range(2, len(list)):
lcm_num = lcm(lcm_num, l... |
s321431951 | p03633 | u346308892 | 1502591539 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3968 | 529 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def lcm(m,n):
if m<n:
return lcm(n,m)
if m==n:
return m
if m%n==0:
return m
g=gcd(m,n)
if g==1:
... |
s435971705 | p03633 | u087279476 | 1502591532 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 821 | def lcm(a, b):
ax = a
bx = b
c = 0
if a<b:
ax, bx = (bx, ax)
while True:
if ax%bx == 0:
gcd = bx
break
else:
c = bx
bx = ax%bx
ax = c
return a*b // gcd
n = int(input())
Mx = int(input())
lst = [Mx]
lst2 = []
for... |
s129372460 | p03633 | u106342872 | 1502591480 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 384 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0:
return int(a)
else:
return int(gcd(int(b), int(a % b)))
def lcm(c, d):
return int(int(c * d) / int(gcd(c, d)))
n = int(input())
k = []
for i in range(n):
k.append(int(input()))
if n == 1:
print(k[0])
else:
p = lcm(k[0],k[1])
... |
s181599355 | p03633 | u868040597 | 1502591373 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 353 | # coding: utf-8
n = int(input())
t = sorted([int(input()) for i in range(n)])
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def nlcm(list):
lcm_num = lcm(list[0], list[1])
if len(list) > 2:
for i in range(2, len(list)):
lcm_num = lcm(lcm_num, li... |
s941352327 | p03633 | u875361824 | 1502591259 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 467 | def main():
N = int(input().strip())
res = int(input().strip())
if N == 1:
return res
for _ in range(1, N):
t = int(input().strip())
res = f(res, t)
print(res)
def f(a, b):
_gcd = gcd(a, b)
return int(a / _gcd * b)
def gcd(a, b):
if b == 0:
return a
... |
s286603618 | p03633 | u106342872 | 1502591241 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 335 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0:
return int(a)
else:
return int(gcd(int(b), int(a % b)))
def lcm(c, d):
return int(int(c * d) / int(gcd(c, d)))
n = int(input())
k = []
for i in range(n):
k.append(int(input()))
p = lcm(k[0],k[1])
for i in range(n):
p = lcm(p,k[i])... |
s380127115 | p03633 | u443170850 | 1502591173 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 589 | import sys
sys.setrecursionlimit(2000000000)
N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = 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 solve(listT):
listlen = len(listT)
ans = -1
whil... |
s250286265 | p03633 | u346308892 | 1502590833 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3952 | 543 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def lcm(m,n):
if m<n:
return lcm(n,m)
#print(m,n)
if m==n:
return m
if m%n==0:
return m
g=gcd(m,... |
s661596683 | p03633 | u346308892 | 1502590761 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3968 | 512 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def lcm(m,n):
if m<n:
return lcm(n,m)
#print(m,n)
if m==n:
return m
if m%n==0:
return m
g=gcd(m,... |
s688260967 | p03633 | u443170850 | 1502590719 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 571 | import sys
sys.setrecursionlimit(2000000000)
N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = 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 solve(listT):
listlen = len(listT)
ans = -1
while... |
s649741131 | p03633 | u125205981 | 1502590713 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3956 | 384 | def main():
N = int(input())
T = tuple(int(input()) for _ in range(N))
lcm_ = T[0]
for i in T:
lcm_ = lcm(i, lcm_)
print(int(lcm_))
def gcd(a, b):
if a < b:
a, b = b, a
r = a % b
if r == 0:
return b
else:
a = b
b = r
return gcd(a, b)... |
s790941802 | p03633 | u106342872 | 1502590673 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 313 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0: return int(a)
return int(gcd(int(b), int(a % b)))
def lcm(c, d):
return int(int(c * d) / int(gcd(c, d)))
n = int(input())
k = []
for i in range(n):
k.append(int(input()))
p = lcm(k[0],k[1])
for i in range(n):
p = lcm(p,k[i])
print(int(p))
|
s271115541 | p03633 | u106342872 | 1502590568 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 298 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0: return int(a)
return int(gcd(b, int(a % b)))
def lcm(c, d):
return int(c * d / gcd(c, d))
n = int(input())
k = []
for i in range(n):
k.append(int(input()))
p = lcm(k[0],k[1])
for i in range(n):
p = lcm(p,k[i])
print(int(p))
|
s341866413 | p03633 | u868040597 | 1502590441 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 327 | # coding: utf-8
n = int(input())
t = sorted([int(input()) for i in range(n)])
def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
def nlcm(list):
lcm_num = lcm(list[0], list[1])
for i in range(2,len(list)):
lcm_num = lcm(lcm_num, list[i])
print(lcm_num)
... |
s464526839 | p03633 | u106342872 | 1502590439 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3952 | 278 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0: return a
return gcd(b, a % b)
def lcm(c, d):
return c * d / gcd(c, d)
n = int(input())
k = []
for i in range(n):
k.append(int(input()))
p = lcm(k[0],k[1])
for i in range(n):
p = lcm(p,k[i])
print(int(p))
|
s834971636 | p03633 | u106342872 | 1502590402 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3952 | 278 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0: return a
return gcd(b, a % b)
def lcm(a, b):
return a * b / gcd(a, b)
n = int(input())
k = []
for i in range(n):
k.append(int(input()))
p = lcm(k[0],k[1])
for i in range(n):
p = lcm(p,k[i])
print(int(p))
|
s870123020 | p03633 | u443170850 | 1502590390 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 570 | import sys
sys.setrecursionlimit(999999999)
N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = 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 solve(listT):
listlen = len(listT)
ans = -1
while ... |
s393922267 | p03633 | u387110752 | 1502590312 | Python | Python (3.4.3) | py | Runtime Error | 133 | 9456 | 745 | import urllib.request
from bs4 import BeautifulSoup
import re
import sys
import os
import time
import subprocess
import datetime
def gcd(a, b):
if a < b:
c = a
a = b
b = c
r = a % b
while r > 0:
a = b
b = r
r = a % b
return b
# ll gcd(ll a, ll b)... |
s954448352 | p03633 | u443170850 | 1502590263 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 525 | N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = 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 solve(listT):
listlen = len(listT)
ans = -1
while True:
ans = lcm(listT[listlen-2], lis... |
s374108534 | p03633 | u106342872 | 1502590087 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3952 | 278 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0: return a
return gcd(b, a % b)
def lcm(a, b):
return a * b / gcd(a, b)
n = int(input())
a = []
for i in range(n):
a.append(int(input()))
p = lcm(a[0],a[1])
for i in range(n):
p = lcm(p,a[i])
print(int(p))
|
s402197628 | p03633 | u125205981 | 1502589961 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3056 | 186 | import math
def main():
N = int(input())
T = tuple(int(input()) for _ in range(N))
gcd_ = math.gcd(max(T), min(T))
ans = max(T) * min(T) // gcd_
print(ans)
main()
|
s615402910 | p03633 | u768816323 | 1502589604 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 284 | def gcd(a,b):
if b>a:
t=b
b=a
a=t
while b>0:
r=a%b
a=b
b=r
return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
i=2
while i <N:
g=gcd(T[i],g)
i+=1
M=g
for i in range(N):
M*=T[i]//g
print(M) |
s426198075 | p03633 | u106342872 | 1502589515 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3952 | 278 | #! -*- coding:utf-8 -*-
def gcd(a, b):
if b == 0: return a
return gcd(b, a % b)
def lcm(a, b):
return a * b / gcd(a, b)
n = int(input())
a = []
for i in range(n):
a.append(int(input()))
p = lcm(a[0],a[1])
for i in range(n):
p = lcm(p,a[i])
print(int(p))
|
s885631677 | p03633 | u233780116 | 1502589498 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3188 | 258 | GCD = 1 ###最大公約数
LCM = 1 ###最小公倍数
N = int(input())
def gcd(a, b):
if a < b:
a, b = b, a
while(b != 0):
a = a % b
a, b = b, a
return a
for i in range(N):
d = int(input())
GCD = gcd(GCD, d)
LCM = LCM * d / GCD
print(int(LCM)) |
s317810130 | p03633 | u294283114 | 1502589426 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 234 | import math
def lcm(x, y):
return int(int(x * y) / math.gcd(x, y))
n = int(input())
t = [i for i in range(n)]
for i in range(n):
t[i] = int(input())
ans = t[0]
for i in range(1, n):
ans = lcm(ans, t[i])
print(int(ans)) |
s403342916 | p03633 | u520829741 | 1502589404 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3900 | 289 | def gcd(a,b):
if a==0:
return b
return gcd(b%a,a)
n=int(input())
arr=[]
for i in range(0,n):
x=int(input())
arr.append(x)
ans=int(0)
if n>1:
ans=arr[0]*arr[1]/gcd(arr[0],arr[1])
for i in range(2,n):
ans=ans*arr[i]/gcd(ans,arr[i])
print(int(ans))
|
s666464412 | p03633 | u562446079 | 1502589111 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 511 | from sympy import reduce
def gcd(*numbers):
"""Return the greatest common divisor of the given integers"""
from fractions import gcd
return reduce(gcd, numbers)
# Least common multiple is not in standard libraries? It's in gmpy, but this is simple enough:
def lcm(*numbers):
"""Return lowest common m... |
s529067637 | p03633 | u768816323 | 1502589035 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 297 | # your code goes here
def gcd(a,b):
if b>a:
t=b
b=a
a=t
while b>0:
r=a%b
a=b
b=r
return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
i=2
while i <N:
g=gcd(T[i],g)
M=g
for i in range(N):
M*=T[i]//g
print(M) |
s988470858 | p03633 | u419832736 | 1502589003 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 277 | N=int(input())
T=[]
for i in range(N):
T.append(int(input()))
import math
def lcm(a,b):
return a*b//math.gcd(a,b)
if N==1:
print(T[0])
elif N==2:
print(lcm(T[0],T[1]))
else:
l=[T[0]]
for i in range(N-1):
l.append(lcm(l[i],T[i+1]))
print(l[-1]) |
s649006038 | p03633 | u346308892 | 1502588926 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3960 | 422 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def glm(m,n):
g=gcd(m,n)
if g==1:
return m*n
return (max(m,n)/g)*min(m,n)
x=[]
N=int(input())
for i in range(N):
x.... |
s821673621 | p03633 | u291945537 | 1502588878 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 458 | N = int(input())
a = list(map(int,[input() for i in range(N)]))
def lcm(x, y):
"""This function takes two
integers and returns the L.C.M."""
# choose the greater number
if x > y:
greater = x
else:
greater = y
while(True):
if((greater % x == 0) and (greater % y == 0)):
... |
s352923810 | p03633 | u741323288 | 1502588779 | Python | Python (3.4.3) | py | Runtime Error | 2127 | 518424 | 834 | #accepted
def prime_dec(num):
i = 2
table = []
while i*i <= num:
while num%i == 0:
num /= i
#print(num)
table.append(int(i))
i += 1
if num > 1:
table.append(int(num))
return table
N = int(input())
t = []
mat = []
gmax = 0
for i in range(N):
new_n= int(input())
t.append(new_n)
#print(new_n)
t... |
s584284723 | p03633 | u966695411 | 1502588766 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 176 | #! /usr/bin/env python3
import math
N = int(input())
T = sorted(set([int(input()) for x in range(N)]))
a = 1
for i in T[:-1] : a *= i
print((a * T[-1]) // math.gcd(a, T[-1]))
|
s355909908 | p03633 | u584459098 | 1502588719 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 5716 | 217 | from fractions import gcd
def lcm(a, b):
return a*b/gcd(a, b)
N = int(input())
T = list(int(input()) for i in range(N))
T = list(set(T))
T.sort()
a = lcm(T[0], T[1])
for i in T[2:]:
a = lcm(a, i)
print(int(a)) |
s203158497 | p03633 | u966695411 | 1502588707 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 232 | #! /usr/bin/env python3
import math
N = int(input())
T = sorted(set([int(input()) for x in range(N)]))
s = set()
for i in T : s = s.union(set(primefactor(i)))
a = 1
for i in T[:-1] : a *= i
print((a * T[-1]) // math.gcd(a, T[-1])) |
s626600226 | p03633 | u346308892 | 1502588694 | Python | Python (3.4.3) | py | Runtime Error | 80 | 3964 | 414 | def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def glm(m,n):
g=gcd(m,n)
if g==1:
return max(m,n)
return (max(m,n)/g)*min(m,n)
x=[]
N=int(input())
for i in range(N):
... |
s328594279 | p03633 | u768816323 | 1502588651 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 304 | # your code goes here
def gcd(a,b):
if b>a:
t=b
b=a
a=t
while b>0:
r=a%b
a=b
b=r
return a
N=int(input())
T=[int(input()) for i in range(N)]
g=gcd(T[0],T[1])
for i in range(1,N-1):
g=gcd(T[i],g)
M=g
for i in range(N):
M*=T[i]//g
print(M) |
s750234437 | p03633 | u346308892 | 1502588640 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3956 | 377 |
def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def glm(m,n):
g=gcd(m,n)
return (max(m,n)/g)*min(m,n)
x=[]
N=int(input())
for i in range(N):
x.append(int(input()))
l=x[0]
fo... |
s178856171 | p03633 | u364618491 | 1502588564 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3944 | 148 | def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
n=int(input())
p=1
for i in range(n):
m=int(input())
p=p*m/gcd(p,m)
print(p) |
s486593974 | p03633 | u443170850 | 1502588535 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 518 | N = int(input())
T = [0 for i in range(N)]
for t in range(N):
T[t] = 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 solve(listT):
listlen = len(listT)
ans = -1
while True:
ans = lcm(listT[listlen-2], lis... |
s327225647 | p03633 | u582243208 | 1502588510 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3948 | 230 | def gcd(a,b):
t = b
b = a % b
if b == 0:
return t
else:
return gcd(t,b)
def lcm(a, b):
return a * b / gcd(a, b)
n = int(input())
ans = 1
for i in range(n):
ans = lcm(ans, int(input()))
print(int(ans)) |
s407553123 | p03633 | u582243208 | 1502588444 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3948 | 225 | def gcd(a,b):
t = b
b = a % b
if b == 0:
return t
else:
return gcd(t,b)
def lcm(a, b):
return a * b / gcd(a, b)
n = int(input())
ans = 1
for i in range(n):
ans = lcm(ans, int(input()))
print(ans) |
s159149820 | p03633 | u562446079 | 1502588340 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 256 | from math import gcd
def lcm(a, b):
return a * b // gcd(a, b)
if __name__ == '__main__':
n = int(input())
arr = []
for _ in range(n):
arr.append(int(input()))
gc = arr[0]
for i in range(1, len(arr)):
gc = lcm(arr[i], gc)
print(gc) |
s727910669 | p03633 | u584459098 | 1502588261 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 5716 | 200 | from fractions import gcd
def lcm(a, b):
return a*b/gcd(a, b)
N = int(input())
T = list(int(input()) for i in range(N))
T.sort()
a = lcm(T[0], T[1])
for i in T[2:]:
a = lcm(a, i)
print(int(a)) |
s841767806 | p03633 | u346308892 | 1502588244 | Python | Python (3.4.3) | py | Runtime Error | 44 | 3956 | 430 |
def spaceinput():
return list(map(int,input().split(" ")))
def gcd(m,n):
if m<n:
return gcd(n, m)
r=m%n
if r == 0:
return n
return gcd(n,r)
def glm(m,n):
return m*n/gcd(m,n)
x=[]
N=int(input())
for i in range(N):
try:
x.append(int(input()))
except:
p... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.