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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s058572978 | p03633 | u322568242 | 1580451488 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 232 | n=int(input())
ans=1
a=[0]*3
for i in range(n):
a[0]=int(ans)
a[1]=temp=int(input())
while 1:
a[2]=int(a[0]%a[1])
a[0]=a[1]
a[1]=a[2]
if a[2]==0:break
ans=ans*temp/a[0]
print(int(ans)) |
s836043270 | p03633 | u322568242 | 1580451287 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 227 | n=int(input())
ans=1
a=[0]*3
for i in range(n):
a[0]=ans
a[1]=temp=int(input())
while 1:
a[2]=int(a[0]%a[1])
a[0]=a[1]
a[1]=a[2]
if a[2]==0:break
ans=ans*temp/a[0]
print(int(ans)) |
s339048970 | p03633 | u358254559 | 1580432851 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 201 | N = int(input())
S = []
for _ in range(N):
S.append(int(input()))
import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
result=1
for num in S:
result = lcm(result,num)
print(result) |
s048652308 | p03633 | u857070771 | 1580258663 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 196 | from fraction import gcd
n=int(input())
t=[]
for _ in range(n):
a=int(input())
t.append(a)
def lcm_base(x,y):
return (x*y // gcd(x,y))
def lcm_list(l):
return reduce(lcm_base,l,1)
|
s692211465 | p03633 | u941753895 | 1580188928 | Python | Python (3.4.3) | py | Runtime Error | 54 | 6348 | 775 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s077710675 | p03633 | u941753895 | 1580188763 | Python | Python (3.4.3) | py | Runtime Error | 53 | 6224 | 767 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s062862554 | p03633 | u941753895 | 1580188498 | Python | Python (3.4.3) | py | Runtime Error | 58 | 6480 | 767 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s258925643 | p03633 | u941753895 | 1580188420 | Python | Python (3.4.3) | py | Runtime Error | 55 | 6228 | 767 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s417365554 | p03633 | u681444474 | 1580174891 | Python | PyPy3 (2.4.0) | py | Runtime Error | 266 | 64028 | 241 | # coding: utf-8
# Your code here!
import fractions
N=int(input())
t=int(input())
l=[t]
for i in range(N-1):
t1=int(input())
l.append(t1)
g=fractions.gcd(t,t1)
t=g
ans=1
for i in range(N):
ans*=l[i]
ans=ans//g
print(ans) |
s364734008 | p03633 | u681444474 | 1580174624 | Python | PyPy3 (2.4.0) | py | Runtime Error | 274 | 64492 | 181 | # coding: utf-8
# Your code here!
import fractions
N=int(input())
t=int(input())
for i in range(N-1):
t1=int(input())
g=fractions.gcd(t,t1)
ans=g*t*t1
t=g
print(ans) |
s065274353 | p03633 | u095426154 | 1580173740 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 184 | # coding: utf-8
import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
N=int(input())
ans=lcm(1,int(input()))
for i in range(N-1):
ans=lcm(ans,int(input()))
print(ans) |
s633437615 | p03633 | u053699292 | 1580171637 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 298 | def GCM( q,r ): #ユークリッドの互除法,最大公約数
if q < r:
q, r = r, q
while( r>0 ):
q, r = r, q%r
return q
def LCM( a,b ):
return int(a / GCM(a,b) * b)
if __name__ == '__main__':
N = int(input())
a = 1
for i in range(0,N):
t = int(input())
a = LCM(a, t)
print(a) |
s037987577 | p03633 | u053699292 | 1580171394 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 298 | def GCM( q,r ): #ユークリッドの互除法,最大公約数
if q < r:
q, r = r, q
while( r>0 ):
q, r = r, q%r
return q
def LCM( a,b ):
return int(a * b / GCM(a,b))
if __name__ == '__main__':
N = int(input())
a = 1
for i in range(0,N):
t = int(input())
a = LCM(a, t)
print(a) |
s867067913 | p03633 | u053699292 | 1580171359 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 298 | def GCM( q,r ): #ユークリッドの互除法,最大公約数
if q < r:
q, r = r, q
while( r>0 ):
q, r = r, q%r
return q
def LCM( a,b ):
return int(a / GCM(a,b) * b)
if __name__ == '__main__':
N = int(input())
a = 1
for i in range(0,N):
t = int(input())
a = LCM(a, t)
print(a) |
s411878812 | p03633 | u053699292 | 1580171265 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 354 | def GCM( q,r ): #ユークリッドの互除法,最大公約数
if q < r:
q, r = r, q
while( r>0 ):
q, r = r, q%r
return q
def LCM( a,b ):
return int(a / GCM(a,b) * b)
if __name__ == '__main__':
N = int(input())
time_lst = []
for i in range(0,N):
t = int(input())
time_lst.append(t)
a = 1
for i in time_lst:
a = LCM(a, i)
print(... |
s436688368 | p03633 | u053699292 | 1580171101 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3064 | 303 | def GCM( q,r ): #ユークリッドの互除法,最大公約数
if q < r:
q, r = r, q
while( r>0 ):
q, r = r, q%r
return q
def LCM( a,b ):
return int(a / GCM(a,b) * b)
if __name__ == '__main__':
n = int(input())
a = int(input())
for i in range(0,n-1):
a = lcm(a, int(input()))
print(a) |
s159107280 | p03633 | u053699292 | 1580171063 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 297 | def GCM( q,r ): #ユークリッドの互除法,最大公約数
if q < r: q, r = r, q
while( r>0 ): q, r = r, q%r
return q
def LCM( a,b ):
return int(a / GCM(a,b) * b)
if __name__ == '__main__':
n = int(input())
a = int(input())
for i in range(0,n-1): a = lcm(a, int(input()))
print(a) |
s269390228 | p03633 | u984264252 | 1579922365 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 282 | def gcd(a, b) -> int:
if(a < b):
tmp = a
a = b
b = tmp
if b == 0:
return a
return gcd(a % b, b)
def lcm(a, b) -> int:
g = gcd(a, b)
return int((a * b) / g)
N = int(input())
ans = int(1)
for i in range(N):
t = int(input())
ans = lcm(ans, t)
print(ans) |
s123251764 | p03633 | u984264252 | 1579922235 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 280 | def gcd(a, b) -> int:
if(a < b):
tmp = a
a = b
b = tmp
if b == 0:
return a
return gcd(a % b, b)
def lcm(a, b) -> int:
g = gcd(a, b)
return int(a * b / g)
N = int(input())
ans = int(1)
for i in range(N):
t = int(input())
ans = lcm(ans, t)
print(ans) |
s448657707 | p03633 | u984264252 | 1579921980 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 242 | def gcd(a, b) -> int:
if(a < b):
tmp = a
a = b
b = tmp
if b == 0:
return a
return gcd(a % b, b)
N = int(input())
ans = int(1)
for i in range(N):
t = int(input())
g = gcd(ans, t)
ans = int(ans * (t / g))
print(ans) |
s018997802 | p03633 | u506287026 | 1579890969 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 277 | from fractions import gcd
n = int(input())
times = [int(input()) for _ in range(n)]
if n == 1:
print(times[0])
else:
prev_lcm = times[0]
for t in times[1:]:
tmp = gcd(prev_lcm, t)
lcm = int(prev_lcm * t / tmp)
prev_lcm = lcm
print(lcm)
|
s021454694 | p03633 | u506287026 | 1579890828 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 257 | from fractions import gcd
n = int(input())
times = [int(input()) for _ in range(n)]
prev_lcm = times[0]
for t in times[1:]:
tmp = gcd(prev_lcm, t)
lcm = int(prev_lcm * t / tmp)
prev_lcm = lcm
if n == 1:
print(times[0])
else:
print(lcm)
|
s649454748 | p03633 | u506287026 | 1579890632 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5052 | 216 | from fractions import gcd
n = int(input())
times = [int(input()) for _ in range(n)]
prev_lcm = times[0]
for t in times[1:]:
tmp = gcd(prev_lcm, t)
lcm = int(prev_lcm * t / tmp)
prev_lcm = lcm
print(lcm)
|
s969291718 | p03633 | u984264252 | 1579874366 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 237 | def gcd(a, b) -> int:
if(a < b):
tmp = a
a = b
b = tmp
if b == 0:
return a
return gcd(a % b, b)
N = int(input())
ans = 1
for i in range(N):
t = int(input())
g = gcd(ans, t)
ans = int(ans * (t / g))
print(ans) |
s079217628 | p03633 | u695079172 | 1579325417 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 291 | from functools import reduce
def gcd(a,b):
while b!=0:
a,b=b,a%b
return a
#最小公倍数
def lcm(a,b):
return a * b//gcd(a,b) a
if __name__ == "__main__":
n = int(input())
lst = []
for i in range(n):
lst.append(int(input()))
print(reduce(lcm,lst))
|
s864438208 | p03633 | u034663022 | 1579282839 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 247 | N = int(input())
T=[int(input()) for _ in range(N)]
def gcd(a, b):
while b != 0:
a, b = b, a % b
return a
def lcm(a, b):
return a * b // gcd(a, b)
ans = lcm(T[0], T[1])
for i in range(2,N-1):
ans = lcm(ans, T[i])
print(ans) |
s560091487 | p03633 | u332253305 | 1579146684 | Python | Python (3.4.3) | py | Runtime Error | 72 | 3948 | 208 |
def gcd(a,b):
if b==0:
return a
return gcd(b,a%b)
def lcm(a,b):
g=gcd(a,b)
return a/g*b
n=int(input())
ans=1
for i in range(n):
t=int(input())
ans=lcm(ans,t)
print(int(ans))
|
s075742278 | p03633 | u121921603 | 1578705207 | Python | PyPy3 (2.4.0) | py | Runtime Error | 286 | 65132 | 232 | """import sys
input = sys.stdin.readline().strip"""
n=int(input())
T=[int(input()) for _ in range(n)]
if n==1:
print(T[0])
from fractions import gcd
ans=T[0]*T[1]//gcd(T[0],T[1])
for t in T:
ans=ans*t//gcd(ans,t)
print(ans)
|
s991565358 | p03633 | u121921603 | 1578705103 | Python | PyPy3 (2.4.0) | py | Runtime Error | 274 | 64492 | 207 | """import sys
input = sys.stdin.readline().strip"""
n=int(input())
T=[int(input()) for _ in range(n)]
from fractions import gcd
ans=T[0]*T[1]//gcd(T[0],T[1])
for t in T:
ans=ans*t//gcd(ans,t)
print(ans)
|
s515811032 | p03633 | u763881112 | 1578686681 | Python | Python (3.4.3) | py | Runtime Error | 2108 | 15156 | 147 |
import numpy as np
import fractions as fra
t=int(input())
ans=1
for _ in range(t):
ans=ans*int(input())/fra.gcd(ans,int(input()))
print(ans) |
s018039359 | p03633 | u577138895 | 1578629703 | Python | PyPy3 (2.4.0) | py | Runtime Error | 185 | 38256 | 216 | 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)
ans = 1
for i in range(N):
ret = ret * T[i] // gcd(ret, T[i])
print(ans) |
s767018334 | p03633 | u577138895 | 1578629668 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38512 | 217 | 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)
ans = 1
for i in range(N):
ret = ret * T[i] // gcd(ret, T[i]])
print(ans) |
s012089309 | p03633 | u577138895 | 1578628647 | Python | PyPy3 (2.4.0) | py | Runtime Error | 306 | 50160 | 226 | 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)
ans = 1
while T:
cur = T.pop(0)
ans = (ans * cur) / gcd(ans, cur)
print(int(ans)) |
s949047295 | p03633 | u531436689 | 1578617103 | Python | Python (3.4.3) | py | Runtime Error | 69 | 6864 | 867 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7
DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(... |
s441866360 | p03633 | u386089355 | 1578583498 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 217 | import math
from functools import reduce
def lcm(x, y):
return (x * y) // math.gcd(x, y)
def lcm_ls(num):
return reduce(lcm, num, 1)
n = int(input())
ls = [int(input()) for _ in range(n)]
print(lcm_ls(ls)) |
s804638130 | p03633 | u530844517 | 1578047966 | Python | PyPy3 (2.4.0) | py | Runtime Error | 285 | 63980 | 169 | from fractions import gcd
import sys
input = sys.stdin.readline
n = int(input())
ans = 1
for _ in range(n):
t = int(input())
ans = ans*x//gcd(ans, x)
print(ans) |
s168545340 | p03633 | u677121387 | 1577934527 | Python | Python (3.4.3) | py | Runtime Error | 72 | 4068 | 296 | def gcd(x,y):
if y == 0:
return x
else:
return gcd(y,x%y)
n = int(input())
t = [int(input()) for i in range(n)]
if n == 1:
ans = t[0]
else:
lcd = t[0]*t[1]/gcd(t[0],t[1])
for i in range(2,n):
lcd = lcd*t[i]/gcd(lcd,t[i])
ans = lcd
print(ans) |
s431551710 | p03633 | u677121387 | 1577934233 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3952 | 234 | def gcd(x,y):
if y == 0:
return x
else:
return gcd(y,x%y)
n = int(input())
t = [int(input()) for i in range(n)]
lcd = t[0]*t[1]/gcd(t[0],t[1])
for i in range(2,n):
lcd = lcd*t[i]/gcd(lcd,t[i])
print(lcd) |
s850860630 | p03633 | u962127640 | 1577933127 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5304 | 202 | import fractions
from functools import reduce
def lcm_list(numbers):
return reduce(fractions.lcm, numbers)
N = int(input())
t = []
for _ in range(N):
t.append(int(input()))
print(lcm_list(t)) |
s679717908 | p03633 | u380933932 | 1577829053 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5304 | 167 | n=int(input())
t=[]
for i in range(n):
t.append(int(input()))
from fractions import gcd
lcm=1
for i in range(n):
lcm=int((lcm*t[i])/gcd(lcm,t[i]))
print(lcm)
|
s619780434 | p03633 | u886655280 | 1577737268 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 313 | N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def gcd(x, y):
while y:
x, y = y, x % y
return x
def lcm_base(x, y):
x_y = x * y
gcd_xy = gcd(x, y)
ans = int(x_y / gcd_xy)
return ans
for i in range(1, N):
T[i] = lcm_base(T[i-1], T[i])
print(T[N - 1])
|
s625307799 | p03633 | u886655280 | 1577736758 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 461 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
import math
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_base(x, y):
x_y = x * y
gcd_xy = math.gcd(x, y)
ans = int(x_y / gcd_xy)
return an... |
s234585517 | p03633 | u886655280 | 1577736703 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 658 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm... |
s647504582 | p03633 | u886655280 | 1577735588 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 584 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_... |
s876008316 | p03633 | u886655280 | 1577735535 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 570 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_... |
s721216493 | p03633 | u886655280 | 1577735455 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 566 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_... |
s615181682 | p03633 | u886655280 | 1577735401 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3700 | 552 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_... |
s857749977 | p03633 | u886655280 | 1577735275 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 522 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
import sys
input = sys.stdin.readline
sys.setrecursionlimit(1000000)
# 最小公倍数を求める問題
# 参考:https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_... |
s485318287 | p03633 | u886655280 | 1577734902 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3700 | 260 | from functools import reduce
import math
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_base(x, y):
return (x * y // math.gcd(x, y))
def lcm_list(list):
return reduce(lcm_base, list, 1)
lcm = lcm_list(T)
print(lcm)
|
s770367565 | p03633 | u886655280 | 1577734790 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 312 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_base(x, y):
return (x * y // math.gcd(x, y))
def lcm_list(list):
return reduce(lcm_base, list, 1)
lcm = lcm_list(T)
print(lcm)
|
s278962325 | p03633 | u886655280 | 1577734739 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 463 | # https://atcoder.jp/contests/abc070/tasks/abc070_c
from functools import reduce
import math
# 最小公倍数を求める問題だ!!
# 参考:
# https://note.nkmk.me/python-gcd-lcm/
# 上記リンク先に最大公約数も載ってた
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_base(x, y):
return (x * y // math.gcd(x, y))
def lcm_list(... |
s235527127 | p03633 | u007263493 | 1577689378 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 118 | import math
n = int(input())
ans = 1
for _ in range(n):
x = int(input())
ans *= x//math.gcd(ans,x)
print(ans) |
s962170360 | p03633 | u007263493 | 1577689317 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 119 | import math
n = int(input())
ans = 1
for _ in range(n):
x = int(input())
ans *= x//math.gcd(ans,x)
print(ans) |
s721033757 | p03633 | u572193732 | 1577314812 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 270 | def gcd(a,b):
while b!=0:
a,b=b,a%b
return a
def lcm(a,b):
return a*b//gcd(a,b)
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
lcm_T = lcm(T[0], T[1])
for i in range(2, N):
lcm_T = lcm(lcm_T, T[i])
print(lcm_T) |
s243526450 | p03633 | u941753895 | 1577169936 | Python | Python (3.4.3) | py | Runtime Error | 44 | 5436 | 719 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s488592687 | p03633 | u905582793 | 1576973219 | Python | Python (3.4.3) | py | Runtime Error | 149 | 12424 | 104 | import numpy as np
n=int(input())
a=np.ndarray([int(input()) for i in range(n)])
print(np.lcm.reduce(a)) |
s537998716 | p03633 | u350267480 | 1576965970 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 146 | import math
def lcm (a, b):
return a // math.gcd(a, b) * b
n = int(input())
g = 1
for _ in range(n):
t = int(input())
g = lcm(t, g)
print(g)
|
s128512294 | p03633 | u329706129 | 1576867937 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 293 | a, b, c, d = map(int, input().split())
if (b <= c or d <= a): print(0)
if (b < d or c < a): print(max(abs(a - d) - abs(a - c) - abs(b - d), abs(b - c) - abs(a - c) - abs(b - d)))
if((a - d) * (b - c) < 0): print(max(abs(a - b) - abs(a - c) - abs(b - d), abs(c - d) - abs(a - c) - abs(b - d)))
|
s874813712 | p03633 | u344959886 | 1576798654 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3688 | 232 | 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)]
print(lcm_list(t)) |
s587922810 | p03633 | u071416928 | 1576790839 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3188 | 330 | a, b, c, d = map(int, input().split())
if b <= c or d <= a:
print(0)
exit()
elif c <= d or a <= b:
print(0)
exit()
elif a <= c and d <= b:
print(d-c)
exit()
elif c <= a and b <= d:
print(b-a)
exit()
elif a <= c and c <= d:
print(b-c)
exit()
elif c <= a and b <= d:
print(d-a)
... |
s738009678 | p03633 | u994521204 | 1576785511 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 279 | n=int(input())
T=[int(input()) for i in range(n)]
def gcd(a,b):
if b==0:
return(a)
else:
return(gcd(b,a%b))
def lgm(a,b):
return(a*b//(gcd(a,b)))
if n==1:
print(T[0])
else:
ans=T[0]
for i in range(1,n):
ans=lgm(ans,T[i])
print(ans) |
s231324929 | p03633 | u225388820 | 1576706795 | Python | Python (3.4.3) | py | Runtime Error | 55 | 5688 | 116 | import fractions as f
n=int(input())
ans=int(input())
for i in range(n-1):
ans=f.lcm(ans,int(input()))
print(ans) |
s885645952 | p03633 | u225388820 | 1576706550 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5048 | 114 | import fractions as f
n=int(input())
ans=int(input())
for i in range(n):
ans=f.lcm(ans,int(input()))
print(ans) |
s813277020 | p03633 | u374802266 | 1576440099 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 427 | import sys
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 int(m*n/gcd(m,n))
n=int(input())
a=[]
if n==1:
print(int(input()))
sys.exit()
for i... |
s264686521 | p03633 | u143278390 | 1576281549 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 281 | 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()))
t.sort()
if(n==1):
print(t[0])
exit()
ans=lcm(t[0],t[1])
if(n==2):
print(ans)
exit()
for i in range(2,n):
ans=lcm(ans,t[i])
print(ans)
|
s994869994 | p03633 | u143278390 | 1576281261 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 342 |
def gcd(x,y):
if x>y: x,y = y,x
while x:
x,y = y%x, x
return y
def lcm(a,b):
return int(a*b /gcd(a,b))
n=int(input())
t=[]
for i in range(n):
t.append(int(input()))
t.sort()
if(n==1):
print(t[0])
exit()
ans=lcm(t[0],t[1])
if(n==2):
print(ans)
exit()
for i in range(2,n):
ans=lcm(... |
s979933105 | p03633 | u143278390 | 1576279226 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 284 | import math
def lcm(a,b):
return int(a*b /math.gcd(a,b))
n=int(input())
t=[]
for i in range(n):
t.append(int(input()))
t.sort()
if(n==1):
print(t[0])
exit()
ans=lcm(t[0],t[1])
if(n==2):
print(ans)
exit()
for i in range(2,n):
ans=lcm(ans,t[i])
print(ans)
|
s349507279 | p03633 | u143278390 | 1576278878 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 213 | import math
def lcm(a,b):
return int(a*b /math.gcd(a,b))
n=int(input())
t=[]
for i in range(n):
t.append(int(input()))
t.sort()
ans=lcm(t[0],t[1])
for i in range(2,n-1):
ans=lcm(ans,t[i])
print(ans)
|
s015577075 | p03633 | u729217226 | 1576180150 | Python | Python (3.4.3) | py | Runtime Error | 154 | 12424 | 200 | import math
import numpy as np
def lcm(x, y):
return (x * y) // np.gcd(x, y)
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0]
for t in T[1:]:
ans = lcm(ans, t)
print(ans) |
s181163097 | p03633 | u729217226 | 1576178733 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 183 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
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) |
s270545329 | p03633 | u729217226 | 1576178620 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3688 | 212 | import math
from functools import reduce
def lcm(x, y):
return (x * y) // math.gcd(x, y)
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) |
s463843804 | p03633 | u721425712 | 1575929136 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3692 | 322 | n = int(input())
t = []
for _ in range(n):
T = int(input())
t.append(T)
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)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(*t... |
s135279124 | p03633 | u981931040 | 1575786492 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 274 | def gcd(a, b):
while b:
a, b = b, a % b
return a
def lcm(x, y):
return (x * y) // gcd(x, y)
N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
print(T)
ans = lcm(T[0] , T[1])
for i in range(2 , N):
ans = lcm(T[i] , ans)
print(ans) |
s258834893 | p03633 | u981931040 | 1575786283 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 226 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
print(T)
ans = lcm(T[0] , T[1])
for i in range(2 , N):
ans = lcm(T[i] , ans)
print(ans) |
s632107117 | p03633 | u135847648 | 1575784543 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 247 | n = int(input())
t = [int(input()) for _ in [0]*n]
def gcd(x, y):
while y:
x, y = y, x % y
return x
def lcm(x, y):
return x * y // gcd (x, y)
ans = lcm(t[0],t[1])
if n>=3:
for i in range(2,n):
ans = lcm(ans,t[i])
print(ans) |
s689582630 | p03633 | u698460655 | 1575774940 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 181 | N = int(input())
data = [0]*N
for i in range(0,N): data[i] = int(input())
import math
ans = data[0]
for i in range(0,N):
ans = ans*data[i] // math.gcd(ans,data[i])
print(ans) |
s465301942 | p03633 | u698460655 | 1575774526 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 179 | N = int(input())
data = [0]*N
for i in range(0,N): data[i] = int(input())
import math
ans = data[0]
for i in range(0,N):
ans = ans*data[i]//math.gcd(ans,data[i])
print(ans) |
s216353900 | p03633 | u780475861 | 1575753004 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 330 | n = int(input())
#n, k = map(int,input().split())
#plst = [int(i) for i in input().split()]
lst = [int(input()) for _ in range(n)]
def a(p, q):
if p % q == 0:
return q
else:
return a(q, p % q)
f = lst[0] * (lst[1] // a(lst[0], lst[1]))
for i in range(2, n):
f = f * (lst[i] // a(f, lst[i])... |
s550211205 | p03633 | u780475861 | 1575752755 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 331 | n = int(input())
#n, k = map(int,input().split())
#plst = [int(i) for i in input().split()]
lst = [int(input()) for _ in range(n)]
def a(p, q):
if p % q == 0:
return q
else:
return a(q, p % q)
f = (lst[0] * lst[1]) // a(lst[0], lst[1])
for i in range(2, n):
f = (f * lst[i]) // a(f, lst[i... |
s070799475 | p03633 | u617440820 | 1575675828 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 174 | import fractions
N = int(input())
Numbers = list(int(input()) for _ in range(N):
ans = T[0]
for i in range(1, N):
ans = ans * T[i] // fractions.gcd(ans, T[i])
print(ans) |
s062473781 | p03633 | u690781906 | 1575469790 | Python | PyPy3 (2.4.0) | py | Runtime Error | 188 | 38384 | 192 | import math
def lcm(a):
x = a[0]
for i in range(1, len(a)):
x = x * a[i] // math.gcd(x, a[i])
return x
n = int(input())
t = [int(input()) for _ in range(n)]
print(lcm(t)) |
s563619336 | p03633 | u543411290 | 1575396406 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 267 | def gmax(a,b):
if a<b:
a,b=b,a
while a%b!=0:
tmp=a
a=b
b=tmp%b
return b
n=int(input())
x=[]
for i in range(n):
x.append(int(input()))
g=gmax(x[0],x[1])
l=x[0]*x[1]//g
for j in range(2,len(x)):
g=gmax(x[j],l)
l=x[j]*l//g
print(l) |
s840447313 | p03633 | u543411290 | 1575392770 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 271 | def gmax(a,b):
if a<b:
a,b=b,a
while a%b!=0:
tmp=a
a=b
b=tmp%b
return b
n=int(input())
x=[]
for i in range(n):
x.append(int(input()))
g=gmax(x[0],x[1])
l=x[0]*x[1]//g
for i in range(2,len(x)):
g=gmax(x[i],l)
l=x[i]*l//g
ans=l
print(ans) |
s838171109 | p03633 | u543411290 | 1575388221 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 272 | def gmax(a,b):
if a<b:
a,b=b,a
while a%b!=0:
tmp=a
a=b
b=tmp%b
return b
n=int(input())
x=[]
for i in range(n):
x.append(int(input()))
g=gmax(x[0],x[1])
l=x[0]*x[1]//g
for i in range(2,len(x)):
g=gmax(x[i],g)
l=x[i]*l//g
ans=l
print(ans) |
s627694230 | p03633 | u941753895 | 1575274211 | Python | Python (3.4.3) | py | Runtime Error | 57 | 6228 | 852 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s660965036 | p03633 | u941753895 | 1575274109 | Python | Python (3.4.3) | py | Runtime Error | 51 | 6220 | 870 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy
sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): ... |
s288398303 | p03633 | u038815010 | 1575054358 | Python | PyPy3 (2.4.0) | py | Runtime Error | 178 | 38396 | 147 | n=int(input())
a=[int(input()) for _ in range(n)]
ans=a[0]
import math
for i in range(1, n):
ans = ans * a[i] // math.gcd(ans, a[i])
print(ans) |
s648317626 | p03633 | u424763114 | 1574990474 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3692 | 525 | import math
from functools import reduce
def main():
n = int(input()) #nは入力回数
t = [int(input()) for _ in range(n)]
if not (1 <= n and n <= 100 and isinstance(n, int)):
return
for i in t:
if not (1 <= i and i <= 10**18 and isinstance(i, int)):
return
k = lcm_list(t)
... |
s699883739 | p03633 | u424763114 | 1574990458 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3696 | 525 | import math
from functools import reduce
def main():
n = int(input()) #nは入力回数
t = [int(input()) for _ in range(n)]
if not (1 <= n and n <= 100 and isinstance(n, int)):
return
for i in t:
if not (1 <= i and i <= 10**18 and isinstance(i, int)):
return
k = lcm_list(t)
... |
s269125959 | p03633 | u403269302 | 1574990198 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5076 | 249 | import fractions
from functools import reduce
def lcm(x, y):
return (x * y) // math.gcd(x, y)
def lcm_rec(num):
return reduce(lcm, num, 1)
N = int(input())
T = [0]*N
for i in range(N):
T[i] = int(input())
ans = lcm_rec(T)
print(ans)
|
s806884547 | p03633 | u403269302 | 1574990130 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3688 | 244 | import math
from functools import reduce
def lcm(x, y):
return (x * y) // math.gcd(x, y)
def lcm_rec(num):
return reduce(lcm, num, 1)
N = int(input())
T = [0]*N
for i in range(N):
T[i] = int(input())
ans = lcm_rec(T)
print(ans)
|
s820287217 | p03633 | u123745130 | 1574922006 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5432 | 166 | import fractions
lst=list(int(input()) for _ in range(int(input())))
ans = lst[0]
for i in range(1, N):
ans = ans * a[i] // fractions.gcd(ans, lst[i])
print(ans)
|
s981296727 | p03633 | u123745130 | 1574921922 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5048 | 161 | import fractions
lst=list(int(input()) for _ in range(int(input())))
ans = a[0]
for i in range(1, N):
ans = ans * a[i] // fractions.gcd(ans, a[i])
print(ans) |
s666084245 | p03633 | u278356323 | 1574876375 | Python | Python (3.4.3) | py | Runtime Error | 46 | 5460 | 339 | # ABC070c
from fractions import gcd
from functools import reduce
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n = int(input())
def lcm_base(a, b):
return a * b // fractions.gcd(a, b)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
t = [int(input()) for _ in range(... |
s539240890 | p03633 | u278356323 | 1574876194 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 308 | # ABC070c
from functools import reduce
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
n = int(input())
def lcm_base(a, b):
return a * b // math.gcd(a, b)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
t = [int(input()) for _ in range(n)]
print(lcm(*t))
|
s599400783 | p03633 | u815878613 | 1574403584 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3688 | 409 | import math
import sys
from functools import reduce
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
def main():
... |
s949158088 | p03633 | u923659712 | 1574177615 | Python | Python (3.4.3) | py | Runtime Error | 154 | 12496 | 126 | import numpy as np
n=int(input())
s=[]
for i in range(n):
a=int(input())
s.append(a)
d=np.array(s)
print(np.lcm.reduce(d)) |
s003160110 | p03633 | u325282913 | 1574136080 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5180 | 220 | import fractions
N = int(input())
tokei = [int(input()) for _ in range(N)]
def lcm(x, y):
return (x * y) // fractions.gcd(x, y)
ans = lcm(tokei[0],tokei[1])
for i in range(2,N):
ans = lcm(ans,tokei[i])
print(ans) |
s960910834 | p03633 | u638795007 | 1573858353 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 857 | def gcd(a,b):
if a>b :
while b!=0:
a,b = b,a%b
return a
elif a==b:
return a
else :
while a!=0:
a,b = b%a,a
return b
def lcm(n,A):
gcdn = [0]*n
lcmn = [0]*n
gcdn[0]=A[0]
lcmn[0]=A[0]
for i in range(n-1):
gcdn[i+1] =... |
s425103265 | p03633 | u940061594 | 1573659531 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 143 | #Multiple Clocks
import math
N = int(input())
T = int(input())
for i in range (N-1):
t = int(input())
T = t*T // math.gcd(t,T)
print(T) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.