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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s234785246 | p03633 | u841531687 | 1586785251 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 158 | import math
n = int(input())
l = list(int(input()) for _ in range(n))
ans = l[0]
for i in range(1, n):
ans = ans * l[i] // math.gcd(ans, l[i])
print(ans) |
s336802156 | p03633 | u535659144 | 1586725287 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 151 | import math
def sks(a,b):
return (a*b)//math.gcd(a,b)
c=int(input())
result=1
for a in range(c):
result=sks(result,int(input()))
print(result) |
s702318824 | p03633 | u852790844 | 1586662113 | Python | Python (3.4.3) | py | Runtime Error | 151 | 12424 | 108 | import numpy as np
n = int(input())
t = [int(input()) for i in range(n)]
ans = np.lcm.reduce(t)
print(ans) |
s020721454 | p03633 | u652569315 | 1586659721 | Python | Python (3.4.3) | py | Runtime Error | 2098 | 734340 | 212 | import sys
sys.setrecursionlimit(10**9)
n=int(input())
t=list(set([int(input()) for _ in range(n)]))
T=max(t)
def f(j):
for i in t:
if (T*j)%i!=0:
return f(j+1)
break
return T*j
print(f(1)) |
s753804590 | p03633 | u385309449 | 1586626822 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 266 | n = int(input())
t = sorted([int(input()) for _ in range(n)],reverse = True)
def c_mul(x,y):
d = x
e = y
while y%x != 0:
z = y%x
y = x
x = z
else:
return d*e//x
for i in range(1,n):
a = c_mul(t[0],t[i])
if a != t[0]:
t[0] = a
print(a) |
s198675703 | p03633 | u931462344 | 1586569102 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 476 | def gcd_core(a, b):
if b == 0:
return a
else:
return gcd_core(b, a % b)
def gcd(arr):
g = gcd_core(arr[0], arr[1])
for i in range(2, len(arr)):
g = gcd_core(g, arr[i])
return g
def lcm_core(a,b):
g = gcd_core(a,b)
return (a*b)//g
def lcm(arr):
l = lcm_core(arr[... |
s513405963 | p03633 | u230621983 | 1586564693 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3692 | 254 | import math
from functools import reduce
n = int(input())
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
t = set()
for _ in range(n):
t.add(int(input()))
print(lcm_list(t)) |
s563477915 | p03633 | u216888678 | 1586553558 | Python | Python (3.4.3) | py | Runtime Error | 25 | 3572 | 316 | 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)
N=int(input())
T=[]
for i in range(N):
Ti=int(input())
T.append(Ti)
print(lcm_list(T)) |
s335244592 | p03633 | u038408819 | 1586388587 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 219 | import math
def multi_lcm(a):
ans = a[0]
for i in range(1, len(a)):
ans = ans * a[i] // fractions.gcd(ans, a[i])
return ans
N = int(input())
T = [int(input()) for _ in range(N)]
print(multi_lcm(T))
|
s999443819 | p03633 | u591503175 | 1586380084 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 467 | def resolve():
'''
code here
'''
import sys
sys.setrecursionlimit(10000000)
N = int(input())
T_list = [int(input()) for _ in range(N)]
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,... |
s559714544 | p03633 | u849029577 | 1586379193 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 234 | 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)) |
s670391958 | p03633 | u060736237 | 1586317634 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 137 | from math import gcd
n = int(input())
T = [int(input()) for i in range(n)]
ans = 1
for t in T:
ans = int(ans*t/gcd(ans,t))
print(ans) |
s589841055 | p03633 | u060736237 | 1586317585 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 133 | from math import gcd
n = int(input())
T = [int(input()) for i in range(n)]
ans = 1
for t in T:
ans = ans*t//gcd(ans,t)
print(ans) |
s565367185 | p03633 | u794910686 | 1586112014 | Python | PyPy3 (2.4.0) | py | Runtime Error | 174 | 38256 | 234 | n=int(input())
T=[]
for _ in range(n):
t = int(input())
T.append(t)
def gcd(a,b):
while b:
a,b=b,a%b
return a
def lcm(a,b):
return a*b//gcd(a,b)
for i in range(n-1):
ans=lcm(T[i], T[i+1])
print(ans) |
s970671659 | p03633 | u420130252 | 1586104599 | Python | PyPy3 (2.4.0) | py | Runtime Error | 162 | 38256 | 178 | import math
n=int(input())
t=[int(input()) for _ in range(n)]
ans=t[0]
def lcm(x,y):
return (x*y)//math.gcd(x,y)
for i in range(1,n):
ans=lcm(ans,t[i])
print(ans)
|
s450184176 | p03633 | u420130252 | 1586104451 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38384 | 175 | import math as mt
n=int(input())
t=[int(input()) for _ in range(n)]
ans=t[0]
def lcm(x,y):
return (x*y)//mt.gcd(x,y)
for i in range(1,n):
ans=lcm(ans,t[i])
print(ans) |
s622339416 | p03633 | u021548497 | 1586066205 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 198 | def gcd(p, q):
if p < q:
p, q = q, p
while q > 0:
p, q = q, p%q
return p
n = int(input())
ans = 1
for i in range(n):
t = int(input())
ans = a*t//gcd(a, t)
print(ans) |
s951123684 | p03633 | u021548497 | 1586066153 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 122 | from fractions import gcd
n = int(input())
ans = 1
for i in range(n):
t = int(input())
ans = a*t//gcd(a, t)
print(ans) |
s000421887 | p03633 | u103520789 | 1586060381 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5104 | 279 | N = int(input())
T_arr = []
for _ in range(N):
T_arr.append(int(input()))
import fractions
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)
print(lcm_list(T_arr)) |
s849760813 | p03633 | u103520789 | 1586060347 | Python | Python (3.4.3) | py | Runtime Error | 102 | 3828 | 274 | N = int(input())
T_arr = []
for _ in range(N):
T_arr.append(int(input()))
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)
print(lcm_list(T_arr)) |
s547829010 | p03633 | u995062424 | 1586059399 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 5432 | 235 | from fractions import gcd
def lcd(x, y):
return (x*y)/gcd(x, y)
N = int(input())
T = [0]*N
for i in range(N):
T[i] = int(input())
num = lcd(T[0], T[1])
for i in range(2, N):
num = lcd(num, T[i])
print(int(num)) |
s992765976 | p03633 | u394731058 | 1585914352 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5432 | 158 | import fractions
n = int(input())
l = [int(input()) for _ in range(n)]
ans = l[i]
for i in range(n):
ans = ans * l[i] // fractions.gcd(ans, l[i])
print(ans) |
s728895915 | p03633 | u546338822 | 1585868298 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 195 | n = int(input())
import math
def main():
m = int(input())
for _ in range(n-1):
t = int(input())
m = m*t//math.gcd(m,t)
print(m)
if __name__ == "__main__":
main() |
s748036968 | p03633 | u668785999 | 1585796542 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 1367 | #include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<queue>
#include<limits>
#include<map>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define ll_INF 9223372036854775807
const stat... |
s050253028 | p03633 | u145950990 | 1585627354 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38384 | 145 | from math import gcd
n = int(input())
ans = 1
for i in range(n):
t = int(input())
if ans%t!=0:
ans = ans*t//gcd(ans,t)
print(ans) |
s318774618 | p03633 | u500006160 | 1585433022 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 176 | from math import gcd
def lcm(x, y):
lcm = (x*y)//gcd(x,y)
return lcm
n = int(input())
ans1 = 1
for _ in range(n):
t=int(input())
ans1 = lcm(ans1, t)
print(ans1) |
s125949927 | p03633 | u500006160 | 1585433005 | Python | PyPy3 (2.4.0) | py | Runtime Error | 168 | 38288 | 176 | from math import gcd
def lcm(x, y):
lcm = (x*y)//gcd(x,y)
return lcm
n = int(input())
ans1 = 1
for _ in range(n):
t=int(input())
ans1 = lcm(ans1, t)
print(ans1) |
s265605811 | p03633 | u404794295 | 1585352561 | Python | Python (3.4.3) | py | Runtime Error | 149 | 13388 | 149 | import numpy as np
def lcd(a,b):
return a*b//np.gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
t=int(input())
T=lcd(t,T)
print(T)
|
s108920136 | p03633 | u404794295 | 1585352317 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 150 | from math import gcd
def lcm(a,b):
return a*b//gcd(a,b)
N=int(input())
T=int(input())
for i in range(N-1):
t=int(input())
T=lcm(T,t)
print(T)
|
s199434662 | p03633 | u469281291 | 1585345535 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 157 | import math
def lcm(a, b):
return (a*b)//math.gcd(a,b)
n = int(input())
ans = 1
for i in range(n):
tmp = int(input())
ans=lcm(ans,tmp)
print(ans) |
s805504258 | p03633 | u549383771 | 1585258212 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 591 | def fcd(a , b):
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t_list = []
ans_list = []
for i in range(n):
t_list.append(int(inp... |
s318203452 | p03633 | u549383771 | 1585225330 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 592 | def fcd(a , b):
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t_list = []
ans_list = []
for i in range(n):
t_list.append(int(inp... |
s210143494 | p03633 | u549383771 | 1585225157 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 592 | def fcd(a , b):
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t_list = []
ans_list = []
for i in range(n):
t_list.append(int(inp... |
s809508684 | p03633 | u549383771 | 1585225101 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 590 | def fcd(a , b):
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t_list = []
ans_list = []
for i in range(n):
t_list.append(int(inp... |
s287095173 | p03633 | u549383771 | 1585224889 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 624 | def fcd(a , b):
if b == 0:
return 0
if a == 0:
return 0
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t... |
s613094857 | p03633 | u549383771 | 1585224783 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 550 | def fcd(a , b):
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t_list = []
ans_list = []
for i in range(n):
t_list.append(int(input())... |
s742873845 | p03633 | u549383771 | 1585224631 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 516 | def fcd(a , b):
if a>= b:
while b != 0:
a,b = b,a%b
return a
else:
while a != 0:
b,a = a,b%a
return b
def lcm(a,b):
return int(a*b/fcd(a , b))
n = int(input())
t_list = []
for i in range(n):
t_list.append(int(input()))
fo... |
s741352865 | p03633 | u549383771 | 1585223437 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 227 | for i in range(len(t_list)):
if i == 0:
continue
elif i == 1:
ans_list.append(lcm(t_list[0] , t_list[1]))
else:
ans_list.append(lcm(ans_list[i-2],t_list[i]))
print(ans_list[-1]) |
s664741432 | p03633 | u437727817 | 1585200353 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3060 | 201 | from math import gcd
from functools import reduce
n = int(input())
t = [int(input()) for _ in range(n)]
def multi(x,y):
return x*y
def lcm(x,y):
return multi(x,y)//gcd(x,y)
print(reduce(lcm,t))
|
s210841507 | p03633 | u676645714 | 1585161319 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3936 | 194 | def gcd(a, b):
return a if b == 0 else gcd(b,a%b)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
lcm = t[0]
for i in t[1:]:
lcm = lcm/gcd(lcm, i)*i
print(int(lcm)) |
s979744522 | p03633 | u676645714 | 1585161106 | Python | Python (3.4.3) | py | Runtime Error | 76 | 4052 | 194 | def gcd(a, b):
return a if b == 0 else gcd(b,a%b)
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
lcm = t[0]
for i in t[1:]:
lcm = lcm*i/gcd(lcm, i)
print(int(lcm)) |
s563614127 | p03633 | u676645714 | 1585160947 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3944 | 228 | def gcd(a, b):
return a if b == 0 else gcd(b,a%b)
n = int(input())
t = []
mul = 1
for i in range(n):
tt = int(input())
mul *= tt
t.append(tt)
lcm = t[0]
for i in t[1:]:
lcm = lcm*i/gcd(lcm, i)
print(int(lcm)) |
s845802098 | p03633 | u156314159 | 1584933913 | Python | Python (3.4.3) | py | Runtime Error | 77 | 4284 | 295 | from collections import defaultdict
N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))
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
res = Ts[0]
for T in Ts:
res = lcm(res, T)
print(int(res))
|
s760949128 | p03633 | u156314159 | 1584933552 | Python | Python (3.4.3) | py | Runtime Error | 79 | 4288 | 299 | from collections import defaultdict
N = int(input())
Ts = list(set([int(input()) for _ in range(N)]))
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
res = Ts[0]
for T in Ts[1:]:
res = lcm(res, T)
print(int(res))
|
s168989719 | p03633 | u332906195 | 1584868695 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 176 | from functools import reduce
import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
N = int(input())
T = [int(input()) for _ in range(N)]
print(reduce(lcm, T, 1))
|
s502408229 | p03633 | u572373398 | 1584716032 | Python | Python (3.4.3) | py | Runtime Error | 48 | 5688 | 293 | import fractions
n = int(input())
t = [int(input()) for i in range(n)]
t.sort()
def lcm(a, b):
return (a * b) // fractions.gcd(a, b)
#入力tについて、最小公倍数を求めればそれが答えとなる
ans = lcm(t[0], t[1])
for i in range(2, n):
ans = lcm(ans, t[i])
print(ans) |
s456755712 | p03633 | u572373398 | 1584715884 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5052 | 285 | import fractions
n = int(input())
t = [int(input()) for i in range(n)]
def lcm(a, b):
return (a * b) // fractions.gcd(a, b)
#入力tについて、最小公倍数を求めればそれが答えとなる
ans = lcm(t[0], t[1])
for i in range(2, n):
ans = lcm(ans, t[i])
print(ans) |
s230312263 | p03633 | u577170763 | 1584654094 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 161 | import math
n = int(input())
t = []
for _ in range(n):
t.append(int(input()))
ans = t[0]
for ti in t:
ans = ans * ti // math.gcd(ans, ti)
print(ans)
|
s249069887 | p03633 | u692515710 | 1584649685 | Python | Python (3.4.3) | py | Runtime Error | 1314 | 683636 | 359 | import sys
sys.setrecursionlimit(200000000)
N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))
def gcd(num1, num2):
if num2 == 0:
return num1
elif num1 == 0:
return 1
else:
return gcd(num2, num1 % num2)
res = NUMS[0]
for num in NUMS[1:]:
res = res... |
s018050115 | p03633 | u692515710 | 1584649521 | Python | Python (3.4.3) | py | Runtime Error | 1284 | 683636 | 322 | import sys
sys.setrecursionlimit(200000000)
N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))
def gcd(num1, num2):
if num2 == 0:
return num1
else:
return gcd(num2, num1 % num2)
res = NUMS[0]
for num in NUMS[1:]:
res = res * num / gcd(res, num)
print(int(res... |
s603906244 | p03633 | u692515710 | 1584649466 | Python | Python (3.4.3) | py | Runtime Error | 1509 | 683636 | 321 | import sys
sys.setrecursionlimit(2000000)
N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))
def gcd(num1, num2):
if num2 == 0:
return num1
else:
return gcd(num2, num1 % num2)
res = NUMS[0]
for num in NUMS[1:]:
res = res * num / gcd(res, num)
print(int(res)... |
s129617461 | p03633 | u692515710 | 1584649291 | Python | Python (3.4.3) | py | Runtime Error | 36 | 3424 | 400 | import sys
sys.setrecursionlimit(2000000)
N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))
def gcd(num1, num2):
if num2 == 0:
return num1
else:
return gcd(num2, num1 % num2)
res = []
for num1 in NUMS:
for num2 in NUMS:
if num1 == num2:
c... |
s176673390 | p03633 | u692515710 | 1584649195 | Python | PyPy3 (2.4.0) | py | Runtime Error | 426 | 64496 | 357 | N = int(input())
NUMS = [int(input()) for _ in range(N)]
NUMS = list(set(NUMS))
def gcd(num1, num2):
if num2 == 0:
return num1
else:
return gcd(num2, num1 % num2)
res = []
for num1 in NUMS:
for num2 in NUMS:
if num1 == num2:
continue
res.append(int(num1 * num2... |
s679663877 | p03633 | u871352270 | 1584507982 | Python | PyPy3 (2.4.0) | py | Runtime Error | 269 | 63980 | 264 | from fractions import gcd
def lcm(list):
if len(list) == 2:
[a, b] = list
return a*b//gcd(a,b)
x = list.pop()
y = lcm(list)
return x*y//gcd(x,y)
N = int(input())
li = []
for i in range(N):
li.append(int(input()))
print(lcm(li)) |
s409354633 | p03633 | u738898077 | 1584507529 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 133 | import math
n = int(input())
t = [int(input()) for i in range(n)]
ans = 1
for i in t:
ans = ans * i // math.gcd(ans,i)
print(ans) |
s662235095 | p03633 | u288147331 | 1584418166 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 176 | n = int(input())
t = [int(input()) for _ in range(n)]
ans = 1
from math import gcd
def lcm(a, b):
return a * b // gcd(a, b)
for v in t:
ans = lcm(ans, v)
print(ans) |
s603557212 | p03633 | u051842502 | 1584320169 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 128 | import math
N,T1=int(input()),int(input())
for n in range(1,N):
T2=int(input())
T1=int(T1*T2/math.gcd(T1,T2))
print(T1)
|
s671946112 | p03633 | u051842502 | 1584319829 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 128 | import math
N,T1=int(input()),int(input())
for n in range(1,N):
T2=int(input())
T1=T1*T2/math.gcd(T1,T2)
print(int(T1))
|
s513116249 | p03633 | u246217175 | 1583978378 | Python | PyPy3 (2.4.0) | py | Runtime Error | 184 | 38384 | 254 | def gcd(a,b):
if b == 0:
return a
else:
return gcd(b,a%b)
n = int(input())
t = [0]*n
for i in range(n):
t[i] = int(input())
ans = t[0]
for i in range(1,n):
ans = int(ans * t[i] / gcd(ans , t[i]))
print(ans) |
s147318202 | p03633 | u246217175 | 1583978059 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38292 | 263 | def gcd(a,b):
if b == 0:
return a
else:
return gcd(b,a%b)
n = int(input())
t = [0]*n
for i in range(n):
t[i] = int(input())
ans = t[0]
for i in range(n-1):
ans = int(ans * t[i+1] / gcd(ans , t[i+1]))
print(int(ans)) |
s369163765 | p03633 | u373047809 | 1583957323 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5052 | 138 | from fractions import gcd
def lcm(a,b):
return a * b // gcd(a,b)
n = int(input())
print(reduce(lcm, [int(input()) for i in range(n)])) |
s828453233 | p03633 | u263824932 | 1583954472 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 256 | import math
from functools import reduce
N=int(input())
list=[]
for a in range(N):
T=int(input())
list.append(T)
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(*list))
|
s490931681 | p03633 | u263824932 | 1583954356 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 227 | import math
N=int(input())
list=[]
for a in range(N):
T=int(input())
list.append(T)
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(*list))
|
s773738987 | p03633 | u263824932 | 1583954301 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 305 | import math
from functools import reduce
N=int(input())
list=[]
for a in range(N):
T=int(input())
if T in list:
continue
else:
list.append(T)
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(*numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(*list))
|
s141501840 | p03633 | u934868410 | 1583799248 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 268 | n = int(input())
t = [int(input()) for _ in range(n)]
def gcd(x,y):
if x % y == 0:
return y
return gcd(y, x % y)
for i in range(n):
for j in range(i+1, n):
if t[i] == 1:
break
t[i] //= gcd(t[i], t[j])
ans = 1
[ans *= x for x in t]
print(ans) |
s078171116 | p03633 | u371409687 | 1583296956 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 192 | import math
def lcm(x, y):
return (x * y) // math.gcd(x, y)
n=int(input())
ans=1
tmp1=int(input())
for i in range(n-1):
tmp2=int(input())
ans=lcm(tmp1,tmp2)
tmp1=ans
print(ans) |
s801153123 | p03633 | u413165887 | 1583019838 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 168 | from math import gcd
n = int(input())
t = [int(input()) for _ in range(n)]
result = t[0]
for i in range(1, n):
result = result*t[i]//gcd(result, t[i])
print(result) |
s444963683 | p03633 | u995062424 | 1582856778 | Python | Python (3.4.3) | py | Runtime Error | 74 | 3948 | 259 | N = int(input())
def gcd(x, y):
if(y == 0):
return x
else:
return gcd(y, x%y)
def lcm(a, b):
g = gcd(a, b)
return ((a*b)/g)
ans = int(input())
for _ in range(N-1):
T = int(input())
ans = lcm(ans, T)
print(int(ans)) |
s019906257 | p03633 | u995062424 | 1582856485 | Python | Python (3.4.3) | py | Runtime Error | 73 | 4024 | 248 | N = int(input())
def gcd(x, y):
if(y == 0):
return x
else:
return gcd(y, x%y)
def lcm(a, b):
g = gcd(a, b)
return ((a*b)/g)
ans = 1
for _ in range(N):
T = int(input())
ans = lcm(ans, T)
print(int(ans)) |
s513782817 | p03633 | u995062424 | 1582855058 | Python | Python (3.4.3) | py | Runtime Error | 2104 | 3064 | 327 | N = int(input())
num = int(input())
div_t = 0
for i in range(N-1):
T = int(input())
if(max(T, num)%min(T, num) == 0):
div_T = max(T, num)
else:
for j in range(2, 10**18+1):
if(max(T, num)*j % min(T, num) == 0):
div_T = max(T, num)*j
break
print(di... |
s714661400 | p03633 | u716043626 | 1582831828 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 185 | import math
n = int(input())
t = [int(input()) for _ in range(n)]
def lcm(x,y):
return (x*y) // math.gcd(x,y)
ans = t[0]
for i in range(1,n):
ans = lcm(ans,t[i])
print(ans) |
s322677708 | p03633 | u627803856 | 1582751856 | Python | PyPy3 (2.4.0) | py | Runtime Error | 268 | 64492 | 196 | n=int(input())
t=[int(input()) for _ in range(n)]
import fractions
a,b=t[0],t[1]
res=a*b//fractions.gcd(a,b)
for i in range(2,n):
tmp=t[i]
res = res*tmp//fractions.gcd(res,tmp)
print(res) |
s532709487 | p03633 | u627803856 | 1582751625 | Python | PyPy3 (2.4.0) | py | Runtime Error | 325 | 64236 | 197 | n=int(input())
t=[int(input()) for _ in range(n)]
import fractions
a,b=t[0],t[1]
res=a*b//fractions.gcd(a,b)
for i in range(2,n-1):
a,b=t[i],t[i+1]
res = a*b//fractions.gcd(a,b)
print(res) |
s084297995 | p03633 | u951480280 | 1582481332 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 254 | 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())
t0=int(input())
t1=int(input())
t_lcm=lcm(t0,t1)
for i in range(n-2):
t2=int(input())
t_lcm=lcm(t_lcm,t2)
print(t_lcm) |
s198415269 | p03633 | u269969976 | 1582443338 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 416 | # coding: utf-8
def get_kouyaku(num1:int, num2:int):
if num1 % num2 == 0:
return num2
return get_kouyaku(num2, num1%num2)
def get_koubai(num1:int, num2:int):
kouyaku = get_kouyaku(num1, num2)
return int(kouyaku * (num1/kouyaku) * (num2/kouyaku))
clock_count = int(input())
clock = [int(input()... |
s750010857 | p03633 | u652569315 | 1582319046 | Python | Python (3.4.3) | py | Runtime Error | 94 | 3960 | 190 | n=int(input())
t=list(set([int(input()) for _ in range(n)]))
T,l=max(t),len(t)
def f(j):
for i in range(l):
if (T*j)%t[i]!=0:
return f(j+1)
break
return T*j
print(f(1)) |
s384241566 | p03633 | u652569315 | 1582318091 | Python | Python (3.4.3) | py | Runtime Error | 76 | 3956 | 188 | n=int(input())
t=list(set([int(input()) for _ in range(n)]))
def f(j):
T=max(t)
for i in range(len(t)):
if (T*j)%t[i]!=0:
return f(j+1)
break
return T*j
print(f(1)) |
s320373213 | p03633 | u652569315 | 1582317803 | Python | Python (3.4.3) | py | Runtime Error | 92 | 3980 | 199 | n=int(input())
t=list(set([int(input()) for _ in range(n)]))
def f(j):
T=max(t)
for i in range(len(t)):
if (T*j)%t[i]!=0:
j+=1
return f(j+1)
break
return T*j
print(f(1)) |
s395047676 | p03633 | u231095456 | 1582311594 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 222 | from math import gcd
from itertools import accumulate
def GCD(args):
return list(accumulate(args,gcd))[-1]
N = int(input())
T = [int(input()) for _ in range(N)]
g = GCD(T)
ans = g
for t in T:
ans *= t//g
print(ans) |
s621727475 | p03633 | u231095456 | 1582311533 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3056 | 224 | from math import gcd
from itertools import accumulate
def GCD(*args):
return list(accumulate(*args,gcd))[-1]
N = int(input())
T = [int(input()) for _ in range(N)]
g = GCD(T)
ans = g
for t in T:
ans *= t//g
print(ans) |
s437717468 | p03633 | u231095456 | 1582311365 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 263 | from math import gcd
from itertools import accumulate
def GCD(*args):
return list(accumulate(*args,gcd))[-1]
def LCM(*args):
g = GCD(args)
return list(accumulate([x//g for x in list(args)], lambda x,y:x*y))[-1]*g
_,*T = open(0)
print(LCM(*map(int,T))) |
s484868066 | p03633 | u375695365 | 1582130379 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 143 |
n=int(input())
t=[int(input()) for _ in range(n)]
ans = t[0]
for i in range(1, n):
ans = ans * a[i] // fractions.gcd(ans, t[i])
print(ans) |
s251100079 | p03633 | u375695365 | 1582130352 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5048 | 161 |
import fractions
n=int(input())
t=[int(input()) for _ in range(n)]
ans = a[0]
for i in range(1, n):
ans = ans * a[i] // fractions.gcd(ans, t[i])
print(ans) |
s814498457 | p03633 | u414458988 | 1581990818 | Python | PyPy3 (2.4.0) | py | Runtime Error | 177 | 38256 | 152 | from fractions import gcd
def lcm(a,b): return a*b//gcd(a,b)
N=int(input())
ans=1
for i in range(N):
t=int(input())
ans=lcm(ans,t)
print(ans) |
s384820963 | p03633 | u076625073 | 1581811287 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 486 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll LCM(ll a, ll b) {
ll GCD = 1;
if (max(a, b) % min(a, b) == 0) {
return max(a, b);
}
else {
for (ll i = 1; i <= min(a, b) / 2; i++) {
if (a % i == 0 && b % i == 0) {
GCD = i;
}
}
}
return a / GCD * b;
}
i... |
s399437226 | p03633 | u076625073 | 1581811259 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 486 | #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll LCM(ll a, ll b) {
ll GCD = 1;
if (max(a, b) % min(a, b) == 0) {
return max(a, b);
}
else {
for (ll i = 1; i <= min(a, b) / 2; i++) {
if (a % i == 0 && b % i == 0) {
GCD = i;
}
}
}
return a / GCD * b;
}
i... |
s242557390 | p03633 | u411203878 | 1581610522 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3688 | 348 | 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(27, 18, 9, 3))
n=int(input())
ab = []
for _ in range(n):
a= int(input())
ab.a... |
s054815329 | p03633 | u987170100 | 1581448000 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 272 | N = int(input())
lst = [int(input()) for _ in range(N)]
def gcd(x, y):
if y == 0:
return x
return gcd(y, x % y)
def lcm(x, y):
return x * y // gcd(max(x, y), min(x, y))
ret = lcm(lst[0], lst[1])
for x in lst[2:]:
ret = lcm(ret, x)
print(ret)
|
s432418277 | p03633 | u783675879 | 1581299329 | Python | PyPy3 (2.4.0) | py | Runtime Error | 172 | 38640 | 211 |
import math
N=int(input())
T = []
for i in range(N):
inp = int(input())
T.append(inp)
cal = T[0]
i = 1
now = T[0]
while(i<N):
m = T[i] * now
now = m // math.gcd(now, T[i])
i+=1
print(now) |
s003947984 | p03633 | u812576525 | 1581294103 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5052 | 288 | #import math
import fractions
from functools import reduce
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_base(x, y):
return (x * y) // functools.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)
print(ans) |
s307130536 | p03633 | u812576525 | 1581293992 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5052 | 273 | import fractions
from functools import reduce
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
def lcm_base(x, y):
return (x * y) // functools.gcd(x, y)
def lcm_list(numbers):
return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)
print(ans) |
s574196006 | p03633 | u812576525 | 1581293935 | Python | Python (3.4.3) | py | Runtime Error | 35 | 5052 | 268 | import fractions
from functools import reduce
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(numbers):
return reduce(lcm_base, numbers, 1)
ans = lcm_list(T)
print(ans) |
s581922064 | p03633 | u810066979 | 1581026689 | Python | Python (3.4.3) | py | Runtime Error | 38 | 5432 | 201 | import sys
import fractions
n=int(input())
list=[]
count=1
ans=1
for i in range(n):
t=int(input())
if not t in list:
list.append(t)
count*=t
ans = fractions.gcd(ans, list[i])
print(count//ans) |
s251042762 | p03633 | u067694854 | 1580876291 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 548 | #include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
ios::sync_with_stdio(false);
cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);
int main() {
int n;
cin >> n;
vector<ll> arr(n, 0);... |
s907369665 | p03633 | u067694854 | 1580876005 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 247 | import math
def lcm(a, b):
return a*b // math.gcd(a, b)
n = int(input())
arr = [int(input()) for _ in range(n)]
if n == 1:
print(n)
else:
ans = lcm(arr[0], arr[1])
for i in range(2, n):
ans = lcm(ans, arr[i])
print(ans) |
s749261492 | p03633 | u172569352 | 1580826381 | Python | Python (3.4.3) | py | Runtime Error | 43 | 5560 | 251 | import fractions
def a(A, B):
C = fractions.gcd(A, B)
return int((A * B)/C)
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
T = sorted(T)
C = T[0]
if N > 1:
for i in range(1, N):
C = a(C, T[i])
print(C)
|
s642179097 | p03633 | u172569352 | 1580826253 | Python | Python (3.4.3) | py | Runtime Error | 37 | 5048 | 233 | import fractions
def a(A, B):
C = fractions.gcd(A, B)
return int((A * B)/C)
N = int(input())
T = []
for _ in range(N):
T.append(int(input()))
T = sorted(T)
C = T[0]
for i in range(1, N):
C = a(C, T[i])
print(C)
|
s748134379 | p03633 | u557792847 | 1580609802 | Python | Python (3.4.3) | py | Runtime Error | 277 | 20748 | 390 | import sys
import numpy as np
# N 時計の数
n = int(input())
# Ti 各時計が1周する秒数
t = []
for i in range(n):
t.append(int(input()))
# 最大公約数を求める
def gcb(a, b):
if b == 0:
return a
return int(gcb(b, a % b))
def lcm(a, b):
g = gcb(a, b)
return int(a / g * b)
ans = 1
for num in t:
ans = lcm(a... |
s768147369 | p03633 | u557792847 | 1580609136 | Python | Python (3.4.3) | py | Runtime Error | 209 | 12904 | 380 | import sys
import numpy as np
# N 時計の数
n = int(input())
# Ti 各時計が1周する秒数
t = []
for i in range(n):
t.append(int(input()))
# 最大公約数を求める
def gcb(a, b):
if b == 0:
return a
return gcb(b, a % b)
def lcm(a, b):
g = gcb(a, b)
return a / g * b
ans = 1
for num in t:
ans = lcm(ans, num)
... |
s913363471 | p03633 | u113971909 | 1580599264 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 251 | #####################
#複数の最小公倍数lcm
#####################
from fractions import gcd
def Lcm(list):
for a in list:
L = (a // gcd(a, L))*L
return L
n= int(input())
A = [int(input()) for i in range(n)]
# A = [2,6,8]
print(Lcm(A))
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.