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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s725917967 | p03633 | u551351897 | 1550823803 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3988 | 298 | import sys
input = sys.stdin.readline
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(n)]
ans = t[0]
for i in range(1,n):
ans = LCM(ans, t[i])
print(int(ans)) |
s664649300 | p03633 | u191829404 | 1550459147 | Python | Python (3.4.3) | py | Runtime Error | 231 | 12900 | 1078 | # https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde s=input() s='abcde'
# abcde s=list(input()) s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ) a=int(input()) a=5
# 1 2 | x,y = map(int,input().split()) | x=1,y=2
# 1 2 3 4 5 ... n li = input().split() li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n li = list(map(int... |
s360701118 | p03633 | u191829404 | 1550458835 | Python | Python (3.4.3) | py | Runtime Error | 231 | 14940 | 1083 | # https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde s=input() s='abcde'
# abcde s=list(input()) s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ) a=int(input()) a=5
# 1 2 | x,y = map(int,input().split()) | x=1,y=2
# 1 2 3 4 5 ... n li = input().split() li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n li = list(map(int... |
s676688499 | p03633 | u191829404 | 1550458644 | Python | Python (3.4.3) | py | Runtime Error | 225 | 12904 | 1080 | # https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde s=input() s='abcde'
# abcde s=list(input()) s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ) a=int(input()) a=5
# 1 2 | x,y = map(int,input().split()) | x=1,y=2
# 1 2 3 4 5 ... n li = input().split() li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n li = list(map(int... |
s590636720 | p03633 | u020604402 | 1550362503 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38256 | 294 | N = int(input())
L = []
for _ in range(N):
L.append(int(input()))
def lcm(x, y):
if x > y:
x,y = y,x
if x == 0:
return y
r = y % x
return lcm(r,x)
def gcd(x,y):
return x*y // lcm(x,y)
ans = gcd(L[1],L[0])
for x in L:
ans = gcd(ans,x)
print(ans) |
s251545003 | p03633 | u020604402 | 1550362447 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38640 | 294 | N = int(input())
L = []
for _ in range(N):
L.append(int(input()))
def lcm(x, y):
if x > y:
x,y = y,x
if x == 0:
return y
r = y % x
return lcm(r,x)
def gcd(x,y):
return x*y // lcm(x,y)
ans = gcd(L[1],L[2])
for x in L:
ans = gcd(ans,x)
print(ans) |
s476973210 | p03633 | u926678805 | 1550273898 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 188 | from functools import reduce
n=int(input())
data=[]
for i in range(n):
data.append(int(input()))
import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
print(reduce(lcm,data)) |
s694367597 | p03633 | u859897687 | 1550019509 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 200 | N = int(input())
T = [int(input()) for _ 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)
l = 1
for i in T:
l = lcm(l, i)
print(l)
|
s595316881 | p03633 | u859897687 | 1550019469 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 212 | N = int(input())
T = [int(input() for _ 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)
ans=1
for i in range(T):
ans = lcm(ans,i)
print(ans)
|
s786700383 | p03633 | u859897687 | 1550019340 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 216 | N = int(input())
T = [int(input() for _ in range(N))]
def gcd(a,b):
while b:
a,b=b,a%b
return b
def lcm(a,b):
return a*b//gcd(a,b)
ans=1
for i in range(T):
ans = lcm(ans,i)
print(ans)
|
s534285116 | p03633 | u785578220 | 1550012918 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 111 | import math
a = int(input())
s = 1
for i in range(a):
t= int(input())
s = (t*s)//gcd(t,s)
print(s)
|
s430102115 | p03633 | u785578220 | 1550012901 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 116 | import math
a = int(input())
s = 1
for i in range(a):
t= int(input())
s = (t*s)//math.gcd(t,s)
print(s)
|
s718375113 | p03633 | u763741681 | 1549838129 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3572 | 212 | import math
from functools import reduce
#C問題
#最小公倍数
N=int(input())
T=[]
for i in range(0,N):
T.append(int(input()))
def lcm_base(x,y):
return (x*y)//math.gcd(x,y)
print(reduce(lcm_base,T)) |
s537629437 | p03633 | u533885955 | 1549743662 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 248 | from functools import reduce
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
def gcd(m,n):
if n == 0:
return m
return gcd(n,m%n)
def lcm(m,n):
return int(m * n/gcd(m,n))
print(reduce(lcm,T)) |
s107886681 | p03633 | u533885955 | 1549743586 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 303 | from functools import reduce
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
ans = 1
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if y == 0:
return x
else:
return gcd(y,x%y)
def lcm(m,n):
return int(m * n/gcd(m,n))
print(reduce(lcm,T)) |
s867678222 | p03633 | u533885955 | 1549743439 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 316 | N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
ans = 1
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if y == 0:
return x
else:
return gcd(y,x%y)
def lcm(m,n):
return int(m * n/gcd(m,n))
for j in range(N):
ans = lcm(ans,T[j])
print(ans) |
s574577307 | p03633 | u533885955 | 1549743222 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 404 | N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
ans = 1
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y!=0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
return... |
s290233005 | p03633 | u533885955 | 1549742990 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 404 | N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
ans = 1
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y!=0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
return... |
s218076267 | p03633 | u533885955 | 1549742450 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 414 | N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
ans = 1
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y!=0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
retu... |
s795704609 | p03633 | u099566485 | 1549340713 | Python | Python (3.4.3) | py | Runtime Error | 77 | 3956 | 361 | #ABC070-C TLE
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(input())
def S(): return input()
def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def lcm(a,b):
g=gcd(a,b)
return a/g*b
n=I()
t=[]
ans=1
for i in range(n):
tmp... |
s349348148 | p03633 | u239981649 | 1549333853 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 150 | from math import gcd
n = int(input())
t = [int(input()) for i in range(n)]
cm = t[0]
for i in range(1, n):
cm = cm*t[i]//gcd(cm, t[i])
print(cm)
|
s084552891 | p03633 | u766684188 | 1549232527 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 265 | n=int(input())
t=list(map(int,[input() for i in range(n)]))
def gcd(x,y):
if y==0:
return x
else:
return gcd(y,x%y)
def lcm(x,y):
return x*y//gcd(x,y)
ans=lcm(t[0],t[1])
for i in range(n-1):
ans=lcm(ans,lcm(t[i],t[i+1]))
print(ans) |
s881129744 | p03633 | u778204640 | 1548962584 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 150 | import math
def lcm(a, b):
return a // math.gcd(a, b) * b
n = int(input())
ans = 1
for i in range(n):
ans = lcm(ans, int(input()))
print(ans)
|
s764224040 | p03633 | u644778646 | 1548653068 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 255 | def gcd(a,b):
while b:
a,b = b,a%b
return a
def lcm(a,b):
return (a*b)/int(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 = int(lcm(ans,T[i]))
print(int(ans))
|
s915059358 | p03633 | u644778646 | 1548652804 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 210 | import math
def lcm(a,b):
return (a*b)/int(ath.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 = int(lcm(ans,T[i]))
print(int(ans))
|
s468145614 | p03633 | u644778646 | 1548652595 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 210 | import math
def lcm(a,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(int(ans),int(T[i]))
print(int(ans)) |
s891289883 | p03633 | u644778646 | 1548652455 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 199 | import math
def lcm(a,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))
|
s562287194 | p03633 | u318345739 | 1548506897 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 454 | import math
def lcm(a, b):
return int(a * b / math.gcd(a, b))
n = int(input())
list = [int(input()) for i in range(n)]
def main():
if n == 1:
print(list[0])
return
num = list[0]
for i in range(1, n):
if num % list[i] == 0:
continue
elif list[i] % num == 0... |
s741416875 | p03633 | u318345739 | 1548506713 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 458 | import math
def lcm(a, b):
return a * b / math.gcd(a, b)
n = int(input())
list = [int(input()) for i in range(n)]
def main():
if n == 1:
print(list[0])
return
num = list[0]
for i in range(1, n):
if (num % list[i] == 0):
continue
elif (list[i] % num == 0):... |
s543615125 | p03633 | u318345739 | 1548506514 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 376 | import math
def lcm(a, b):
return a * b / math.gcd(a, b)
n = int(input())
list = [int(input()) for i in range(n)]
if n == 1:
print(list[0])
exit(1)
num = list[0]
for i in range(1, n):
if (num % list[i] == 0):
continue
elif (list[i] % num == 0):
num = list[i]
continue
... |
s400900794 | p03633 | u426108351 | 1548371303 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 162 | from fractions import gcd
N = int(input())
a = int(input())
for i in range(N-1):
b = int(input())
c = a * b / gcd(a, b)
a = b
b = c
print(int(c))
|
s751209267 | p03633 | u426108351 | 1548370742 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 241 | def gcd(a, b):
A = min([a, b])
B = max([a, b])
while b:
a, b = b, a % b
return a
N = int(input())
a = int(input())
for i in range(N-1):
b = int(input())
c = a * b / gcd(a, b)
a = b
b = c
print(int(c))
|
s731644717 | p03633 | u426108351 | 1548370499 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 189 | def gcd(a, b):
while b:
a, b = b, a % b
return a
N = int(input())
a = int(input())
for i in range(N-1):
b = int(input())
c = a * b / gcd(a, b)
a = b
b = c
print(int(c))
|
s240775006 | p03633 | u593063683 | 1548016246 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 287 | # ABC 070
import math
def getInt(): return int(input())
def getIntFromRows(n): return [int(input()) for i in range(n)]
N1019 = 10**19
N = getInt()
T = getIntFromRows(N)
a = T[0]
lcm = T[0]
for i in range(1, N):
gcd = math.gcd(a, T[i])
lcm = a * T[i] // gcd
a = gcd
print(lcm) |
s391132182 | p03633 | u607865971 | 1547870220 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 197 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
ans = T[0]
for t in T:
ans = lcm(ans, t)
print(ans)
|
s573477258 | p03633 | u607865971 | 1547870069 | Python | PyPy3 (2.4.0) | py | Runtime Error | 182 | 38384 | 196 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
ans = T[0]
for t in T:
ans = lcm(ans, t)
print(ans) |
s333845743 | p03633 | u607865971 | 1547870035 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 196 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
ans = T[0]
for t in T:
ans = lcm(ans, t)
print(ans) |
s621687356 | p03633 | u607865971 | 1547869981 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 199 | from math import gcd
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
def lcm(x, y):
return (x * y) // gcd(x, y)
ans = T[0]
for t in T:
ans = lcm(ans, t)
print(ans)
|
s915141298 | p03633 | u607865971 | 1547869865 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 229 | N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
from math import gcd
from functools import reduce
def lcm(x, y):
return (x * y) // gcd(x, y)
ans = T[0]
for t in T:
ans = lcm(ans, t)
print(ans)
|
s556671843 | p03633 | u607865971 | 1547869756 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 202 | N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
from math import gcd
from functools import reduce
def lcm(x, y):
return (x * y) // gcd(x, y)
ans = reduce(lcm, T)
print(ans) |
s247227981 | p03633 | u329865314 | 1547309367 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 222 | def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return int(a/gcd(a,b)*b)
n = int(input())
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s648710248 | p03633 | u924406834 | 1547096594 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 327 | import sys
sys.setrecursionlimit(10000)
def gcd(n1,n2):
if n1 > n2:
n1,n2 = n2,n1
if n2 % n1 == 0:return n1
else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]//gcd(t[0],t[1])
for i in range(n-2):
check = (check*t[i+2])//gcd(check,t[i+2])
print(int(... |
s616449248 | p03633 | u924406834 | 1547095848 | Python | Python (3.4.3) | py | Runtime Error | 76 | 3892 | 286 | def gcd(n1,n2):
if n1 > n2:
n1,n2 = n2,n1
if n2 % n1 == 0:return n1
else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]/gcd(t[0],t[1])
for i in range(n-2):
check = (check*t[i+2])//gcd(check,t[i+2])
print(int(check)) |
s377019916 | p03633 | u924406834 | 1547089056 | Python | Python (3.4.3) | py | Runtime Error | 77 | 3892 | 283 | def gcd(n1,n2):
if n1 > n2:
n1,n2 = n2,n1
if n2 % n1 == 0:return n1
else: return gcd(n2%n1,n1)
n = int(input())
t = [int(input()) for i in range(n)]
check = t[0]*t[1]/gcd(t[0],t[1])
for i in range(n-2):
check = check*t[i+2]/gcd(check,t[i+2])
print(int(check)) |
s129318851 | p03633 | u813102292 | 1546837468 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 222 | def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return int(a/gcd(a,b)*b)
n = int(input())
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s960192747 | p03633 | u813102292 | 1546837439 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 223 | def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return long(a/gcd(a,b)*b)
n = int(input())
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s108135328 | p03633 | u813102292 | 1546837257 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3948 | 223 | 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 i in range(n):
t = int(input())
ans = lcm(ans,t)
print(int(ans)) |
s376830569 | p03633 | u813102292 | 1546837218 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 224 | n = int(input())
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return long(a/gcd(a,b)*b)
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s289393683 | p03633 | u813102292 | 1546836555 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 223 | n = int(input())
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return int(a/gcd(a,b)*b)
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s132016285 | p03633 | u813102292 | 1546836475 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 225 | def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return int(a/gcd(a,b)*b)
n = int(input())
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s515231285 | p03633 | u813102292 | 1546836304 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 252 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def lcm(a,b):
res = int(a/gcd(a,b)*b)
return res
n = int(input())
ans=1
for i in range(n):
t = int(input())
ans = lcm(ans,t)
print(ans) |
s635729091 | p03633 | u813102292 | 1546836182 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 288 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def lcm(a,b):
res = int(a/gcd(a,b)*b)
return res
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
ans=1
for i in range(n):
ans = lcm(ans,t[i])
print(ans)
|
s467817720 | p03633 | u813102292 | 1546836156 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 287 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def lcm(a,b):
res = int(a/gcd(a,b)*b)
return res
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
ans=1
for i in range(n):
ans = lcm(ans,t[i])
print(ans) |
s861384498 | p03633 | u813102292 | 1546836067 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3948 | 273 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def lcm(a,b):
g = gcd(a,b)
return a/g*b
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
ans=1
for i in range(n):
ans = lcm(ans,t[i])
print(ans) |
s678811722 | p03633 | u813102292 | 1546835778 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 278 | def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
def lcm(a,b):
g = gcd(a,b)
return int(a/g*b)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s400492070 | p03633 | u813102292 | 1546835558 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 265 |
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
g = gcd(a,b)
return int(a/g*b)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s980849957 | p03633 | u813102292 | 1546835520 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 255 |
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return int(a/gcd(a,b)*b)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s078643435 | p03633 | u813102292 | 1546835434 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 255 |
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
return int(a*b/gcd(a,b))
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s373841255 | p03633 | u813102292 | 1546835372 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3948 | 250 |
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())
t = []
for i in range(n):
t.append(int(input()))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s757258194 | p03633 | u813102292 | 1546835338 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 254 |
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())
t = []
for i in range(n):
t.append(int(input()))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s077571524 | p03633 | u813102292 | 1546835125 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3316 | 254 | n = int(input())
t = []
for i 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):
return int(a*b/gcd(a,b))
res=1
for i in range(n):
res = lcm(res,t[i])
print(res) |
s559979069 | p03633 | u813102292 | 1546834732 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 436 | #ABC070
n = int(input())
t = []
for i 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):
return int(a*b/gcd(a,b))
# a,b,cの最小公倍数→lcm(lcm(a,b),c)で表される
# t[i]の最小公倍数を求めればよい。
res=t[0]
for i in range(1,n):
if res>=t[i]:
res ... |
s242056542 | p03633 | u813102292 | 1546830407 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 376 | #ABC070
n = int(input())
t = []
for i 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):
return int(a*b/gcd(a,b))
# a,b,cの最小公倍数→lcm(lcm(a,b),c)で表される
# t[i]の最小公倍数を求めればよい。
res=t[0]
for i in range(1,n):
res = lcm(res,t[i])
print(... |
s495697256 | p03633 | u795630164 | 1546211973 | Python | Python (3.4.3) | py | Runtime Error | 2103 | 3060 | 247 | N = int(input())
T = [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)
now = lcm(T[0], T[1])
for i in range(1, N):
now = lcm(now, T[i])
print(now)
|
s636414603 | p03633 | u795630164 | 1546211924 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 248 | N = int(input())
T = [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)
now = lcm(T[0], T[1])
for i in range(1, N):
now = lcm(now, T[i])
print(now)
|
s805248412 | p03633 | u735763891 | 1546071618 | Python | Python (3.4.3) | py | Runtime Error | 52 | 5816 | 218 | def abc070_c():
from fractions import gcd
n = int(input())
t = [int(input()) for _ in range(n)]
ans = 1
for i in range(n):
ans = int(ans * t[i] / gcd(ans, t[i]))
print(ans)
abc070_c() |
s276271545 | p03633 | u735763891 | 1546071474 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 213 | def abc070_c():
from math import gcd
n = int(input())
t = [int(input()) for _ in range(n)]
ans = 1
for i in range(n):
ans = int(ans * t[i] / gcd(ans, t[i]))
print(ans)
abc070_c() |
s915161106 | p03633 | u887207211 | 1545764199 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 229 | N = int(input())
T = [int(input()) for _ in range(N)]
import math
def lcm(x, y):
return (x*y) // math.gcd(x, y)
result = []
for i in range(N):
try:
result.append(lcm(T[i], T[i+1]))
except:
break
print(max(result)) |
s976714599 | p03633 | u624475441 | 1545680696 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 168 | def gcd(a, b):
while b:
a, b = b, a % b
return b
ans = 1
for _ in range(int(input())):
t = int(input())
ans = ans * t // gcd(ans, t)
print(ans) |
s649413213 | p03633 | u619819312 | 1545617362 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 129 | from fraction import gcd
a=int(input())
s=int(input())
k=s
for i in range(a-1):
d=int(input())
k=(k*d)//gcd(k,d)
print(k) |
s016496769 | p03633 | u880373275 | 1545253526 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 266 | from math import gcd
def lcm(a, b):
return abs(a*b) // gcd(a, b)
def main():
n = int(input())
ts = [int(input()) for _ in range(n)]
res = ts[0]
for t in ts[1:]:
res = lcm(res, t)
print(res)
if __name__ == '__main__':
main()
|
s697393435 | p03633 | u001024152 | 1545195337 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 149 | from math import gcd
N = int(input())
ans = int(input())
for _ in range(N-1):
t = int(input())
g = gcd(t, ans)
ans = ans*t//g
print(ans) |
s667029292 | p03633 | u363407238 | 1545004281 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 232 | import math
from functools import reduce
n=int(input())
tl=[int(input()) for _ 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(*tl)) |
s706003649 | p03633 | u017810624 | 1544947425 | Python | Python (3.4.3) | py | Runtime Error | 42 | 5432 | 167 | import fractions
def lcm(a,b):
return (a*b)//fractions.gcd(a,b)
n=int(input())
x=lcm(int(input()),int(input()))
for i in range(n-2):
x=lcm(x,int(input()))
print(x) |
s051526522 | p03633 | u138486156 | 1544570206 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3572 | 244 | import math
from functools import reduce
n = int(input())
a = [int(input()) for _ in range(n)]
def lcm_base(x, y):
return (x*y)//math.gcd(x, y)
def lcm(nums):
#3つ目は初期値
return reduce(lcm_base, nums, 1)
print(lcm(a))
|
s881409600 | p03633 | u983918956 | 1544464934 | Python | Python (3.4.3) | py | Runtime Error | 37 | 5048 | 213 | import fractions
N = int(input())
T = [int(input()) for i in range(N)]
T = list(set(T))
pro = T[0]
for i in range(1,len(T)):
gcd = fractions.gcd(pro,T[i])
lcm = (pro * T[i]) // gcd
pro = lcm
print(lcm) |
s829212052 | p03633 | u983918956 | 1544464899 | Python | Python (3.4.3) | py | Runtime Error | 37 | 5048 | 208 | import fractions
N = int(input())
T = [int(input()) for i in range(N)]
T = list(set(T))
pro = T[0]
for i in range(1,N):
gcd = fractions.gcd(pro,T[i])
lcm = (pro * T[i]) // gcd
pro = lcm
print(lcm) |
s404552548 | p03633 | u983918956 | 1544464197 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5052 | 191 | import fractions
N = int(input())
T = [int(input()) for i in range(N)]
pro = T[0]
for i in range(1,N):
gcd = fractions.gcd(pro,T[i])
lcm = (pro * T[i]) // gcd
pro = lcm
print(lcm) |
s031074079 | p03633 | u397531548 | 1544062571 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 319 | N=int(input())
l=[]
for i in range(N):
l.append(int(input()))
import fraction
from functools import reduce
def gcd_list(numbers):
return reduce(fractions.gcd, numbers)
def lcm_base(x, y):
return (x * y) // fractions.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm_list(l)) |
s342682897 | p03633 | u397531548 | 1544062380 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 309 | N=int(input())
l=[]
for i in range(N):
l.append(int(input()))
import fraction
from functools import reduce
def gcd_list(numbers):
return reduce(math.gcd, numbers)
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)) |
s897105602 | p03633 | u397531548 | 1544062212 | Python | Python (3.4.3) | py | Runtime Error | 30 | 3804 | 305 | N=int(input())
l=[]
for i in range(N):
l.append(int(input()))
import math
from functools import reduce
def gcd_list(numbers):
return reduce(math.gcd, numbers)
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)) |
s923167131 | p03633 | u576434377 | 1543990386 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 454 | import itertools
import math
def gcd(a,b):
while b:
a, b = b, a % b
return a
def lcm(left, right):
return (int(left) * int(right)) / int(gcd(left, right))
N = int(input().strip())
Ts = []
for i in range(N):
Ts.append(int(input().strip()))
res = 0
if len(Ts) == 0:
res = 0
elif len(Ts) ... |
s283436974 | p03633 | u576434377 | 1543986663 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 364 | import itertools
import math
def gcd(a,b):
while b:
a, b = b, a % b
return a
def lcm(left, right):
return (int(left) * int(right)) / int(gcd(left, right))
N = int(input().strip())
Ts = []
for i in range(N):
Ts.append(int(input().strip()))
res = int(lcm(Ts[0], Ts[1]))
for T in Ts[2:]:
... |
s859798127 | p03633 | u576434377 | 1543985357 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 299 | import itertools
import math
def lcm(left,right):
return (int(left) * int(right)) / int(math.gcd(left,right))
N = int(input().strip())
Ts = []
for i in range(N):
Ts.append(int(input().strip()))
res = int(lcm(Ts[0], Ts[1]))
for T in Ts[2:]:
res = int(lcm(res, T))
print(int(res))
|
s842015267 | p03633 | u576434377 | 1543985249 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 291 | import itertools
import math
def lcm(left,right):
return (int(left) * int(right)) / int(math.gcd(left,right))
N = int(input().strip())
Ts = []
for i in range(N):
Ts.append(int(input()))
res = int(lcm(Ts[0], Ts[1]))
for T in Ts[2:]:
res = int(lcm(res, T))
print(int(res))
|
s947723839 | p03633 | u142415823 | 1543797654 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 272 | def gcd(a, b):
if a < b:
a, b = b ,a
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
for t in T[1:]:
ans = lcm(ans, t)
print(ans) |
s746600670 | p03633 | u142415823 | 1543795785 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 238 | def gcd(a, b):
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
for t in T[1:]:
ans = lcm(ans, t)
print(ans) |
s545252332 | p03633 | u142415823 | 1543795676 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 238 | def gcd(a, b):
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
for t in T[1:]:
ans = lcm(t, ans)
print(ans) |
s566554840 | p03633 | u142415823 | 1543795474 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 230 | def gcd(a, b):
while b > 0:
a, b = b, a % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
N = int(input())
T = [int(input()) for i in range(N)]
a = T[0]
for b in T[1:]:
a = lcm(a, b)
print(a) |
s708526037 | p03633 | u054106284 | 1543702997 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 292 | def kouyaku(a,b):
aa = max(a,b)
bb = min(a,b)
if bb == 0:
return aa
else:
return kouyaku(bb,aa%bb)
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
ans = T[0]
for time in T:
ans = int( ans / kouyaku(ans, time) * time)
print(ans) |
s801935897 | p03633 | u054106284 | 1543702565 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 335 | def kouyaku(a,b):
aa = max(a,b)
bb = min(a,b)
if bb == 0:
return aa
else:
return kouyaku(bb,aa%bb)
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
ans = 0
for time in T:
if ans:
ans = int( ans * time / kouyaku(ans, time) )
else:
ans = time
... |
s607728492 | p03633 | u054106284 | 1543702097 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 357 | def kouyaku(a,b):
aa = max(a,b)
bb = min(a,b)
if bb == 0:
return aa
else:
return kouyaku(bb,aa%bb)
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
T.sort()
T.reverse()
ans = 0
for time in T:
if ans:
ans = int( ans * time / kouyaku(ans, time) )
els... |
s353655320 | p03633 | u969850098 | 1543194147 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 219 | from math import gcd
num_clock = int(input())
times = [int(input()) for i in range(num_clock)]
spent_time = times[0]
for time in times[1:]:
spent_time = (spent_time * time) // gcd(spent_time, time)
print(spent_time) |
s561205682 | p03633 | u557437077 | 1542872355 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 410 | def gcd(a, b):
while b > 0:
tmp = a
a = b
b = tmp % b
return a
def lcm(a, b):
tmp = gcd(a, b)
return int((a/tmp) * b)
n = int(input())
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
t = sorted(t)
sum = t[0]
for i in range(1, n):
# print("sum:{} t:{} ... |
s104507289 | p03633 | u557437077 | 1542872238 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 410 | def gcd(a, b):
while b > 0:
tmp = a
a = b
b = tmp % b
return a
def lcm(a, b):
tmp = a / gcd(a, b)
return int(tmp * b)
n = int(input())
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
t = sorted(t)
sum = t[0]
for i in range(1, n):
# print("sum:{} t:{} ... |
s766263619 | p03633 | u557437077 | 1542872193 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 398 | def gcd(a, b):
while b > 0:
tmp = a
a = b
b = tmp % b
return a
def lcm(a, b):
return int(a * (b / gcd(a, b)))
n = int(input())
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
t = sorted(t)
sum = t[0]
for i in range(1, n):
# print("sum:{} t:{} lcm:{}".form... |
s884884924 | p03633 | u557437077 | 1542872079 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 398 | def gcd(a, b):
while b > 0:
tmp = a
a = b
b = tmp % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
n = int(input())
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
t = sorted(t)
sum = t[0]
for i in range(1, n):
# print("sum:{} t:{} lcm:{}".form... |
s638759771 | p03633 | u557437077 | 1542871780 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 384 | def gcd(a, b):
while b > 0:
tmp = a
a = b
b = tmp % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
n = int(input())
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
sum = t[0]
for i in range(1, n):
# print("sum:{} t:{} lcm:{}".format(sum, t, lcm... |
s496019121 | p03633 | u557437077 | 1542871056 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 1854 | def gcd(a, b):
a, b = min(a, b), max(a, b)
if a == 0:
return b
else:
return gcd(b % a, a)
def lcm(a, b):
return int((a * b) / gcd(a, b))
n = int(input())
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
sum = t[0]
for i in ra... |
s138163075 | p03633 | u557437077 | 1542871001 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 1802 | def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(a, b):
return int((a * b) / gcd(a, b))
n = int(input())
# つまり全t[i]で割り切れる値を出せということ
# 最小公倍数を出せばよい
t = [0 for i in range(n)]
for i in range(n):
t[i] = int(input())
sum = t[0]
for i in range(1, n):
# print("sum:{} t:{} lcm:{}".format(s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.