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
s345191542
p03633
u779455925
1573646076
Python
Python (3.4.3)
py
Runtime Error
18
3060
184
import math def lcm(x, y): return (x * y) // math.gcd(x, y) N=int(input()) T=[int(input()) for i in range(N)] temp=T[0] for i in range(1,N): temp=lcm(temp,T[i]) print(temp)
s896955702
p03633
u161318582
1573508718
Python
Python (3.4.3)
py
Runtime Error
18
3060
181
import math n = int(input()) t = [int(input()) for _ in range(n)] def lcm(x, y): return (x * y) // math.gcd(x, y) ans = 1 for i in range(n): ans = lcm(t[i],ans) print(ans)
s199230558
p03633
u637551956
1573506893
Python
Python (3.4.3)
py
Runtime Error
151
12468
91
import numpy N=int(input()) L = [int(input()) for i in range(N)] print(numpy.lcm.reduce(L))
s294193307
p03633
u314050667
1573478179
Python
Python (3.4.3)
py
Runtime Error
17
3064
316
import sys import math if N == 1: print(T[0]) sys.exit() def GCD(a,b): if b == 0: return a return GCD(b,a%b) N = int(input()) T = [int(input()) for _ in range(N)] def SKS(a,b): return (a*b)//GCD(a,b) for i in range(1,N): if i == 1: temp = SKS(T[0], T[1]) continue temp = SKS(temp, T[i]) print(temp)
s180281400
p03633
u314050667
1573478090
Python
Python (3.4.3)
py
Runtime Error
17
3064
270
import math def GCD(a,b): if b == 0: return a return GCD(b,a%b) N = int(input()) T = [int(input()) for _ in range(N)] def SKS(a,b): return (a*b)//GCD(a,b) for i in range(1,N): if i == 1: temp = SKS(T[0], T[1]) continue temp = SKS(temp, T[i]) print(temp)
s914913495
p03633
u768896740
1573275138
Python
Python (3.4.3)
py
Runtime Error
23
3688
292
import math from functools import reduce n = int(input()) clock_list = [] for i in range(n): a = int(input()) clock_list.append(a) 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(clock_list))
s702606890
p03633
u819048695
1573055823
Python
Python (3.4.3)
py
Runtime Error
17
3060
141
import math n=int(input()) t=int(input()) lcm=t a=t for i in range(n-1): t=int(input()) a=math.gcd(lcm,t) lcm=lcm*t//a print(lcm)
s501518059
p03633
u314089899
1573012409
Python
Python (3.4.3)
py
Runtime Error
18
3060
327
#70c 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_set = set() for _ in range(N): t = int(input()) T_set.add(t) T_list = list(T_set) print(lcm_list(T_...
s679355167
p03633
u117348081
1572482606
Python
Python (3.4.3)
py
Runtime Error
18
3060
175
import math def lcm(a,b): return a*b//math.gcd(a,b) n = int(input()) t = [ int(input()) for _ in range(n)] ans = 1 for i in range(n): ans = lcm(ans, t[i]) print(ans)
s591480760
p03633
u368882459
1572132720
Python
Python (3.4.3)
py
Runtime Error
76
3964
258
n = int(input()) t = [int(input()) for _ in range(n)] def gcd(a, b): a, b = map(int, [min(a, b), max(a, b)]) if b % a == 0: return a else: return gcd(a, b - a) lcm = 1 for ti in t: lcm = ti // gcd(lcm, ti) * lcm print(lcm)
s880042668
p03633
u368882459
1572132633
Python
Python (3.4.3)
py
Runtime Error
18
2940
204
def gcd(a, b): a, b = map(int, [min(a, b), max(a, b)]) if b % a == 0: return a else: return gcd(a, b - a) lcm = 1 for ti in t: lcm = ti // gcd(lcm, ti) * lcm print(lcm)
s942611015
p03633
u368882459
1572132181
Python
Python (3.4.3)
py
Runtime Error
75
3964
298
n = int(input()) t = [int(input()) for _ in range(n)] def gcd(a, b): a, b = map(int, [min(a, b), max(a, b)]) if b % a == 0: return a else: return gcd(a, b - a) if n == 1: print(t[-1]) exit() lcm = 1 for ti in t: lcm = ti // gcd(lcm, ti) * lcm print(lcm)
s261450798
p03633
u368882459
1572131840
Python
Python (3.4.3)
py
Runtime Error
17
2940
173
import math n = int(input()) t = [int(input()) for _ in range(n)] if n == 1: print(t[-1]) exit() lcm = 1 for ti in t: lcm = ti//math.gcd(lcm, ti)*lcm print(lcm)
s828508117
p03633
u368882459
1572131127
Python
Python (3.4.3)
py
Runtime Error
17
3060
201
import math n = int(input()) t = [int(input()) for _ in range(n)] if n == 1: print(t[-1]) exit() for i in range(1, n): lcm = t[i-1]//math.gcd(t[i-1], t[i])*t[i] t[i] = lcm print(t[-1])
s972206782
p03633
u368882459
1572130734
Python
Python (3.4.3)
py
Runtime Error
17
3064
201
import math n = int(input()) t = [int(input()) for _ in range(n)] if n == 1: print(t[-1]) exit() for i in range(1, n): lcm = t[i-1]*t[i]//math.gcd(t[i-1], t[i]) t[i] = lcm print(t[-1])
s751811224
p03633
u368882459
1572130374
Python
Python (3.4.3)
py
Runtime Error
18
3060
148
import math n = int(input()) t = [int(input()) for _ in range(n)] for i in range(1, n): t[i] = t[i-1]*t[i]//math.gcd(t[i-1], t[i]) print(t[-1])
s725949938
p03633
u368882459
1572129095
Python
Python (3.4.3)
py
Runtime Error
18
3064
483
import math n = int(input()) t = [int(input()) for _ in range(n)] t_max = max(t) i = 1 def is_prime(num): if n == 1: return False for k in range(2, int(math.sqrt(num) + 1)): if n % k == 0: return False else: return True primes = [] for ti in t: if is_prime(ti): ...
s592515661
p03633
u598229387
1572115853
Python
Python (3.4.3)
py
Runtime Error
17
3064
214
n=int(input()) t=[int(input()) for i in range(n)] def gcd(a,b): while b: a,b=b,a%b return a check=gcd(t[0],t[1]) ans=t[0]*t[1]//check for i in range(2,n): check=gcd(ans,t[i]) ans=ans*t[i]//check print(ans)
s782681218
p03633
u215315599
1572095377
Python
Python (3.4.3)
py
Runtime Error
17
3064
316
import sys import os sys.setrecursionlimit(10000000000000) def lcm(x,y): return (x*y)//gcd(x,y) def gcd(x,y): if y <= 0: return x else: return gcd(y,x%y) N = int(input()) T = [int(input()) for _ in range(N)] ans = lcm(T[0],T[1]) for i in range(2,N): ans = lcm(ans,T[i]) print(ans)
s741463401
p03633
u215315599
1572095340
Python
Python (3.4.3)
py
Runtime Error
17
3060
318
import sys import os sys.setrecursionlimit(1000000000000000) def lcm(x,y): return (x*y)//gcd(x,y) def gcd(x,y): if y <= 0: return x else: return gcd(y,x%y) N = int(input()) T = [int(input()) for _ in range(N)] ans = lcm(T[0],T[1]) for i in range(2,N): ans = lcm(ans,T[i]) print(ans)
s950395767
p03633
u215315599
1572095299
Python
Python (3.4.3)
py
Runtime Error
18
3064
310
import sys import os sys.setrecursionlimit(100000000) def lcm(x,y): return (x*y)//gcd(x,y) def gcd(x,y): if y <= 0: return x else: return gcd(y,x%y) N = int(input()) T = [int(input()) for _ in range(N)] ans = lcm(T[0],T[1]) for i in range(2,N): ans = lcm(ans,T[i]) print(ans)
s650224163
p03633
u215315599
1572095247
Python
Python (3.4.3)
py
Runtime Error
17
3064
297
import sys sys.setrecursionlimit(100000) def lcm(x,y): return (x*y)//gcd(x,y) def gcd(x,y): if y <= 0: return x else: return gcd(y,x%y) N = int(input()) T = [int(input()) for _ in range(N)] ans = lcm(T[0],T[1]) for i in range(2,N): ans = lcm(ans,T[i]) print(ans)
s717694376
p03633
u215315599
1572095207
Python
Python (3.4.3)
py
Runtime Error
17
3064
285
sys.setrecursionlimit(100000) def lcm(x,y): return (x*y)//gcd(x,y) def gcd(x,y): if y <= 0: return x else: return gcd(y,x%y) N = int(input()) T = [int(input()) for _ in range(N)] ans = lcm(T[0],T[1]) for i in range(2,N): ans = lcm(ans,T[i]) print(ans)
s023360920
p03633
u905203728
1572036866
Python
Python (3.4.3)
py
Runtime Error
17
2940
147
from math import gcd def lcm(x,y): return (x*y)//gcd(x,y) n=int(input()) t=int(input()) for i in range(n-1): t=lcm(t,int(input())) print(t)
s784114029
p03633
u593590006
1571878693
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38384
555
# Python Program to find LCM of n elements def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while(rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm n=int(input()) if n==...
s504559428
p03633
u593590006
1571878578
Python
PyPy3 (2.4.0)
py
Runtime Error
182
38384
515
# Python Program to find LCM of n elements def find_lcm(num1, num2): if(num1>num2): num = num1 den = num2 else: num = num2 den = num1 rem = num % den while(rem != 0): num = den den = rem rem = num % den gcd = den lcm = int(int(num1 * num2)/int(gcd)) return lcm n=int(input()) l=[int...
s658213045
p03633
u622045059
1571531772
Python
Python (3.4.3)
py
Runtime Error
178
5852
202
import fractions N = int(input()) T = [int(input()) for _ in range(N)] def lcm(a,b): return int(a * b / fractions.gcd(a,b)) ans = T[0] for i in range(1, N): ans = lcm(ans, T[i]) print(ans)
s113988301
p03633
u785578220
1571458173
Python
Python (3.4.3)
py
Runtime Error
17
2940
117
import math a = int(input()) s = 1 for i in range(a): t= int(input()) s = (t*s)//math.gcd(t,s) print(s)
s206107639
p03633
u066455063
1571188317
Python
Python (3.4.3)
py
Runtime Error
18
3060
212
import math def lcm(x, y): return (x*y) // math.gcd(x, y) N = int(input()) ans = 0 for i in range(N): T = int(input()) if i == 0: ans = T else: ans = lcm(ans, T) print(ans)
s590540328
p03633
u066455063
1571188248
Python
Python (3.4.3)
py
Runtime Error
18
2940
216
from math import gcd def lcm(x, y): return (x*y) // gcd(x, y) N = int(input()) ans = 0 for i in range(N): T = int(input()) if i == 0: ans = T else: ans = lcm(ans, T) print(ans)
s748998640
p03633
u066455063
1571188023
Python
Python (3.4.3)
py
Runtime Error
17
2940
216
from math import gcd def lcm(x, y): return (x*y) // gcd(x, y) N = int(input()) ans = 0 for i in range(N): T = int(input()) if i == 0: ans = T else: ans = lcm(ans, T) print(ans)
s306249122
p03633
u527261492
1570936849
Python
Python (3.4.3)
py
Runtime Error
38
5432
148
import fractions n=int(input()) t=[] for i in range(n): t.append(int(input())) a=t[0] for i in range(n-1): a=fractions.gcd(a,a[i+1]) print(a)
s572145650
p03633
u318042557
1570935475
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38256
252
N = int(input()) T = [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 a * b // gcd(a, b) ans = T[1] for i in range(N): ans = lcm(ans, T[i]) print(ans)
s657775442
p03633
u922487073
1570760164
Python
Python (3.4.3)
py
Runtime Error
19
3064
250
# a < b def gcd(a,b): if b % a == 0: return a return gcd(b % a, a) def lcm(a,b): return int(a*b/gcd(a,b)) N = int(input()) T = [int(input()) for _ in range(N)] T = sorted(T) ret = 1 for t in T: ret = lcm(ret, t) print(ret)
s764199048
p03633
u886747123
1570259281
Python
Python (3.4.3)
py
Runtime Error
23
3572
237
import math from functools import reduce N = int(input()) T = [int(input()) for _ in range(N)] def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) print(lcm_list(T))
s221315658
p03633
u094191970
1570137183
Python
Python (3.4.3)
py
Runtime Error
51
5688
166
from fractions import gcd n=int(input()) t=[int(input()) for i in range(n)] for i in range(0,n-1): lcm=(t[i]*t[i+1]//gcd(t[i],t[i+1])) t[i+1]=lcm print(lcm)
s130052347
p03633
u094191970
1570136951
Python
Python (3.4.3)
py
Runtime Error
51
5688
162
from fractions import gcd n=int(input()) t=[int(input()) for i in range(n)] for i in range(1,n): lcm=(t[i]*t[i-1]//gcd(t[i],t[i-1])) t[i]=lcm print(lcm)
s203642034
p03633
u993622994
1570052462
Python
Python (3.4.3)
py
Runtime Error
52
5604
211
import fractions N = int(input()) T = [int(input()) for _ in range(N)] def lcm(A, B): return (A * B) // fractions.gcd(A, B) num = lcm(T[0], T[1]) for i in range(2, N): num = lcm(num, T[i]) print(num)
s844904553
p03633
u993622994
1570052255
Python
Python (3.4.3)
py
Runtime Error
18
3064
201
import math N = int(input()) T = [int(input()) for _ in range(N)] def lcm(A, B): return (A * B) // math.gcd(A, B) num = lcm(T[0], T[1]) for i in range(2, N): num = lcm(num, T[i]) print(num)
s946173043
p03633
u033606236
1570049381
Python
Python (3.4.3)
py
Runtime Error
17
3060
135
import math n = int(input()) ary = [int(input()) for _ in range(n)] ans = 1 for i in ary: ans = (ans*i)//math.gcd(ans,i) print(ans)
s067726753
p03633
u540799318
1569889376
Python
PyPy3 (2.4.0)
py
Runtime Error
273
64108
613
import sys import fractions from collections import Counter, deque, defaultdict from math import factorial import heapq, bisect import math import itertools sys.setrecursionlimit(10 ** 5 + 10) INF = 10**15 +5 def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, inpu...
s296860606
p03633
u540799318
1569889269
Python
PyPy3 (2.4.0)
py
Runtime Error
275
64620
596
import sys import fractions from collections import Counter, deque, defaultdict from math import factorial import heapq, bisect import math import itertools sys.setrecursionlimit(10 ** 5 + 10) INF = 10**15 +5 def input(): return sys.stdin.readline().strip() def INT(): return int(input()) def MAP(): return map(int, inpu...
s098971267
p03633
u033606236
1569860221
Python
Python (3.4.3)
py
Runtime Error
18
2940
137
import math n = int(input()) ans = int(input()) for i in range(n-1): a = int(input()) ans = ans // math.gcd(ans,a) * a print(ans)
s187411860
p03633
u033606236
1569860098
Python
Python (3.4.3)
py
Runtime Error
18
3060
137
import math n = int(input()) ans = int(input()) for i in range(n-1): a = int(input()) ans = ans // math.gcd(ans,a) * a print(ans)
s920991233
p03633
u033606236
1569860006
Python
Python (3.4.3)
py
Runtime Error
17
2940
137
import math n = int(input()) ans = int(input()) for i in range(n-1): a = int(input()) ans = ans // math.gcd(ans,a) * a print(ans)
s704583857
p03633
u952656646
1569794057
Python
Python (3.4.3)
py
Runtime Error
23
3572
209
from functools import reduce def gcd(a, b): return gcd(b, a%b) if b!=0 else a def lcd(a, b): return int(a*b/gcd(a,b)) N = int(input()) T = [int(input()) for _ in range(N)] l = reduce(lcd, T) print(l)
s509486527
p03633
u131406572
1569590750
Python
Python (3.4.3)
py
Runtime Error
23
3688
230
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))
s757592946
p03633
u146575240
1569286301
Python
Python (3.4.3)
py
Runtime Error
47
5560
319
# C - Multiple Clocks # import math mathはatcoderでは使えない from fractions import gcd N = int(input()) T = [int(input()) for i in range(N)] # 最小公倍数を求める DP = [0]*(N-1) DP[0] = (T[0]*T[1])//gcd(T[0],T[1]) for i in range(1,N-1): DP[i] = (DP[i-1]*T[i+1]) // gcd(DP[i-1],T[i+1]) print(DP[-1])
s555334824
p03633
u146575240
1569286074
Python
Python (3.4.3)
py
Runtime Error
17
3064
268
# C - Multiple Clocks import math N = int(input()) T = [int(input()) for i in range(N)] # 最小公倍数を求める DP = [0]*(N-1) DP[0] = (T[0]*T[1])//math.gcd(T[0],T[1]) for i in range(1,N-1): DP[i] = (DP[i-1]*T[i+1]) // math.gcd(DP[i-1],T[i+1]) print(DP[-1])
s440348563
p03633
u027929618
1569279048
Python
Python (3.4.3)
py
Runtime Error
17
3060
146
import math n=int(input()) def lcm(a, b): return (a * b) // math.gcd(a, b) num = 1 for i in range(n): num = lcm(num, int(input())) print(num)
s154045790
p03633
u027929618
1569278746
Python
Python (3.4.3)
py
Runtime Error
23
3688
208
import math from functools import reduce n=int(input()) T=[int(input())for _ in range(n)] def lcm(a, b): return (a * b) // math.gcd(a, b) def lcm_list(num): return reduce(lcm, num, 1) print(lcm_list(T))
s729488857
p03633
u252828980
1569185434
Python
Python (3.4.3)
py
Runtime Error
18
3060
269
n = int(input()) li = [] for i in range(n): li.append(int(input())) def gcd1(a,b): while b: a,b = b,a%b return a def lcm1(a,b): return a*b//gcd1(a,b) num = li[0] num = lcm1(li[0],li[1]) for i in range(2,len(li)): num = lcm1(num,li[i]) print(num)
s143462783
p03633
u252828980
1569185357
Python
Python (3.4.3)
py
Runtime Error
17
3064
260
n = int(input()) li = [] for i in range(n): li.append(int(input())) def gcd1(a,b): while b: a,b = b,a%b return a def lcm1(a,b): return a*b//gcd1(a,b) num = 0 num = lcm1(li[0],li[1]) for i in range(2,len(li)): num = lcm1(num,li[i]) print(num)
s846887779
p03633
u131634965
1569184714
Python
Python (3.4.3)
py
Runtime Error
31
3828
262
import math from functools import reduce n=int(input()) def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm(*numbers): return reduce(lcm_base, numbers, 1) num_list=[] for _ in range(n): num_list.append(int(input())) print(lcm(*num_list))
s825356721
p03633
u131634965
1569184644
Python
Python (3.4.3)
py
Runtime Error
23
3700
291
n=int(input()) # 最上公倍数を考える 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) num_list=[] for _ in range(n): num_list.append(int(input())) print(lcm(*num_list))
s541587173
p03633
u155687575
1569179718
Python
Python (3.4.3)
py
Runtime Error
18
3060
228
def gcd(x, y): while y > 0: x, y = y, x%y return x def lcm(x, y): return x/gcd(x, y)*y n = int(input()) val = int(input()) for i in range(n-1): tmp = int(input()) val = int(lcm(val, tmp)) print(val)
s173737287
p03633
u155687575
1569179399
Python
Python (3.4.3)
py
Runtime Error
18
3060
238
def gcd(x, y): while y > 0: x, y = y, x%y return x def lcm(x, y): return x/gcd(x, y)*y n = int(input()) val = int(input()) for i in range(n-1): tmp = int(input()) val = lcm(val, tmp) print('{:d}'.format(val))
s530401474
p03633
u155687575
1569178877
Python
Python (3.4.3)
py
Runtime Error
24
3572
225
def gcd(x, y): while y > 0: x, y = y, x%y return x def lcm(x, y): return x/gcd(x, y)*y from functools import reduce n = int(input()) li = [int(input()) for _ in range(n)] print(str(int(reduce(lcm, li))))
s787634559
p03633
u155687575
1569178836
Python
Python (3.4.3)
py
Runtime Error
23
3572
225
def gcd(x, y): while y > 0: x, y = y, x%y return x def lcm(x, y): return x/gcd(x, y)*y from functools import reduce n = int(input()) li = [int(input()) for _ in range(n)] print(str(int(reduce(lcm, li))))
s092382664
p03633
u780962115
1569110954
Python
Python (3.4.3)
py
Runtime Error
35
5048
138
import fractions n=int(input()) glm=1 for i in range(n): nums=int(input()) glm=int(glm*nums/fractions.gcd(nums,glm)) print(glm)
s451931378
p03633
u395202850
1569110902
Python
Python (3.4.3)
py
Runtime Error
18
2940
97
n = int(input()) a = 1 for b in range(n): b = int(input()) a = a*b//gcd(a, b) print(a)
s550283227
p03633
u395202850
1569110831
Python
Python (3.4.3)
py
Runtime Error
18
2940
115
import math n = int(input()) a = 1 for b in range(n): b = int(input()) a = a*b//math.gcd(a, b) print(a)
s651577192
p03633
u780962115
1569110552
Python
Python (3.4.3)
py
Runtime Error
36
5048
292
import fractions n=int(input()) lists=[] glmlists=[] for s in range(n): s=int(input()) lists.append(s) lists.append(1) glm=lists[0] cnt=0 while cnt<n: gcd=fractions.gcd(glm,lists[cnt+1]) glm=int(glm*lists[cnt+1]/gcd) glmlists.append(glm) cnt+=1 print(glmlists[-1])
s394450965
p03633
u780962115
1569110265
Python
Python (3.4.3)
py
Runtime Error
17
2940
255
import fractions n=int(input()) lists=[] for s in range(n): s=int(input()) lists.append(s) lists.append(1) glm=lists[0] cnt=0 while cnt<n: gcd=fractions.gcd(glm,lists[cnt+1]) glm=int(glm*lists[cnt+1]/gcd) cnt+=1 print(glm)
s469534462
p03633
u780962115
1569109755
Python
Python (3.4.3)
py
Runtime Error
51
5688
246
import fractions n=int(input()) lists=[] for s in range(n): s=int(input()) lists.append(s) lists.append(1) glm=lists[0] cnt=0 while cnt<n: gcd=fractions.gcd(glm,lists[cnt+1]) glm=int(glm*lists[cnt+1]/gcd) cnt+=1 print(glm)
s346960888
p03633
u780962115
1569109664
Python
Python (3.4.3)
py
Runtime Error
75
5600
259
import fractions n=int(input()) lists=[] for s in range(n): s=int(input()) lists.append(s) lists.append(1) print(lists) glm=lists[0] cnt=0 while cnt<n: gcd=fractions.gcd(glm,lists[cnt+1]) glm=int(glm*lists[cnt+1]/gcd) cnt+=1 print(glm)
s803098361
p03633
u780962115
1569109576
Python
Python (3.4.3)
py
Runtime Error
18
3064
236
import math n=int(input()) lists=[] for s in range(n): s=int(input()) lists.append(s) lists.append(1) glm=lists[0] cnt=0 while cnt<n: gcd=math.gcd(glm,lists[cnt+1]) glm=int(glm*lists[cnt+1]/gcd) cnt+=1 print(glm)
s846901877
p03633
u780962115
1569109487
Python
Python (3.4.3)
py
Runtime Error
18
3060
255
import math n=int(input()) lists=[] for s in range(n): s=int(input()) lists.append(s) lists.append(1) print(lists) glm=lists[0] cnt=0 while cnt<n: gcd=math.gcd(glm,lists[cnt+1]) glm=int(glm*lists[cnt+1]/gcd) cnt+=1 print(glm)
s972287372
p03633
u288280761
1569056223
Python
Python (3.4.3)
py
Runtime Error
23
3564
515
import sys from collections import defaultdict, deque from functools import reduce import math input = sys.stdin.readline def chmax(a, b): if a > b: return a else: return b def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm(*numbers): return reduce(lcm_base, numbers, 1) de...
s003086009
p03633
u896741788
1569034608
Python
Python (3.4.3)
py
Runtime Error
18
2940
183
n=int(input()) l=list(set([int(input()) for d in range(n)])) a=l[0] sd=0 for i in l[1:]: for h in range(min(i,a)+1)[:0:-1]: if (a%h,i%h)==(0,0):sd=h,break a=a*i//sd print(a)
s752647164
p03633
u948522631
1569028901
Python
Python (3.4.3)
py
Runtime Error
18
3060
168
import math n=int(input()) T=[] for i in range(n): T.append(int(input())) ans=T[0] for i in range(1,len(T)): ans=ans*T[i]//math.gcd(int(ans),T[i]) print(int(ans))
s655743492
p03633
u948522631
1569028778
Python
Python (3.4.3)
py
Runtime Error
18
3060
167
import math n=int(input()) T=[] for i in range(n): T.append(int(input())) ans=T[0] for i in range(1,len(T)): ans=ans*T[i]/math.gcd(int(ans),T[i]) print(int(ans))
s957232409
p03633
u390883247
1569019475
Python
Python (3.4.3)
py
Runtime Error
18
3064
694
def gcm(a,b): if a < b: a,b = b,a while True: if a % b == 0: return b else: a,b = b,a % b def lcm(a,b): g = gcm(a,b) return a*b//g; N = int(input()) Data = [] for _ in range(N): Data.append(int(input())) ans = Data[0] for i in range(1,N): ans = l...
s652880662
p03633
u893063840
1568833739
Python
Python (3.4.3)
py
Runtime Error
343
22060
162
# -*- coding: utf-8 -*- from numpy import lcm n = int(input()) t = [int(input()) for _ in range(n)] ans = 1 for ele in t: ans = lcm(ans, ele) print(ans)
s834184361
p03633
u893063840
1568833562
Python
Python (3.4.3)
py
Runtime Error
17
2940
208
# -*- coding: utf-8 -*- from math import gcd def lcm(x, y): return x * y // gcd(x, y) n = int(input()) t = [int(input()) for _ in range(n)] ans = 1 for ele in t: ans = lcm(ans, ele) print(ans)
s722334944
p03633
u850491413
1568637511
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38384
420
import sys from collections import deque, defaultdict import copy import bisect #sys.setrecursionlimit(10 ** 9) import math import heapq from itertools import product, permutations,combinations import sys def input(): return sys.stdin.readline().strip() N = int(input()) T = [] for i in range(N): T.append(int(input...
s082913084
p03633
u296518383
1568612727
Python
Python (3.4.3)
py
Runtime Error
17
3064
227
N=int(input()) T=[int(input()) for _ in range(N)] T=list(set(T)) #print(T) def gcd(a,b): if b==0: return a else: return gcd(b,a%b) ans=T[0] for i in range(N): #print(ans) ans=ans*T[i]//gcd(ans,T[i]) print(ans)
s446833156
p03633
u296518383
1568612579
Python
Python (3.4.3)
py
Runtime Error
18
3064
226
N=int(input()) T=[int(input()) for _ in range(N)] T=list(set(T)) print(T) def gcd(a,b): if b==0: return a else: return gcd(b,a%b) ans=T[0] for i in range(N): #print(ans) ans=ans*T[i]//gcd(ans,T[i]) print(ans)
s528276686
p03633
u291766461
1568594375
Python
Python (3.4.3)
py
Runtime Error
19
3316
203
import math def lcm(x, y): return (x * y) // math.gcd(x, y) N = int(input()) T = [int(input()) for _ in range(N)] base = lcm(T[0], T[1]) for i in range(2, N): base = lcm(base, T[i]) print(base)
s108365308
p03633
u174273188
1568578979
Python
PyPy3 (2.4.0)
py
Runtime Error
175
38640
364
from math import gcd from functools import reduce def resolve(): n = int(input()) t = list(int(input()) for _ in range(n)) res = 1 for ti in t: res = lcm_base(res, ti) print(res) def lcm_base(x, y): return x * y // gcd(x, y) def lcm(numbers): return reduce(lcm_base, numbers, 1)...
s482880315
p03633
u174273188
1568578840
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38256
306
from math import gcd from functools import reduce def resolve(): n = int(input()) t = list(int(input()) for _ in range(n)) print(lcm(t)) def lcm_base(x, y): return x * y // gcd(x, y) def lcm(numbers): return reduce(lcm_base, numbers, 1) if __name__ == "__main__": resolve()
s732240465
p03633
u174273188
1568578310
Python
Python (3.4.3)
py
Runtime Error
18
2940
320
from math import gcd from functools import reduce def resolve(): n = int(input()) t = list(int(input()) for _ in range(n)) ans = lcm(t) print(ans) def lcm_base(x, y): return x * y // gcd(x, y) def lcm(numbers): return reduce(lcm_base, numbers, 1) if __name__ == "__main__": resolve()
s900297853
p03633
u386819480
1568172771
Python
Python (3.4.3)
py
Runtime Error
17
3060
727
#!/usr/bin/env python3 import sys # from fractions import gcd from math import gcd from functools import reduce def lcm(x, y): return (x * y) // gcd(x, y) def solve(N: int, T: "List[int]"): print(reduce(lcm, T)) return # Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools (tips: You use ...
s548451678
p03633
u645250356
1568163781
Python
Python (3.4.3)
py
Runtime Error
39
5144
503
from collections import Counter,defaultdict import sys,heapq,bisect,math,itertools,string,queue,fractions mod = 10**9+7 def inp(): return int(sys.stdin.readline()) def inpl(): return list(map(int, sys.stdin.readline().split())) def inpln(n): return list(int(sys.stdin.readline()) for i in range(n)) def inpl_str(): retur...
s629494918
p03633
u185948224
1568133227
Python
Python (3.4.3)
py
Runtime Error
35
5048
200
from fractions import gcd import sys input = sys.stdin.readline N = int(input()) T = list([int(input()) for _ in range(N)]) ans = T[0] for i in T: ans = int(ans/gcd(ans, i))* i print(ans)
s039499519
p03633
u185948224
1568116417
Python
Python (3.4.3)
py
Runtime Error
49
5472
200
from fractions import gcd import sys input = sys.stdin.readline N = int(input()) T = list([int(input()) for _ in range(N)]) ans = T[0] for i in T: ans = int(ans* i/gcd(ans, i)) print(ans)
s953903857
p03633
u231685196
1568003622
Python
Python (3.4.3)
py
Runtime Error
17
3060
227
import math n = int(input()) s = int(input()) def gcd_core(a, b): if b == 0: return a else: return gcd_core(b, a % b) for i in range(1,n): t = int(input()) s = (s*t)//math.gcd_core(s,t) print(s)
s304129616
p03633
u231685196
1568003582
Python
Python (3.4.3)
py
Runtime Error
17
2940
126
import math n = int(input()) s = int(input()) for i in range(1,n): t = int(input()) s = (s*t)//math.gcd(s,t) print(s)
s386384363
p03633
u395202850
1567987392
Python
Python (3.4.3)
py
Runtime Error
23
3572
429
import math from functools import reduce def gcd(*numbers): return reduce(math.gcd, numbers) def gcd_list(numbers): return reduce(math.gcd, numbers) 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 red...
s731079888
p03633
u934529721
1567903728
Python
Python (3.4.3)
py
Runtime Error
89
4204
242
import math from functools import reduce n = int(input()) a = [int(input()) for i in range(n)] def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) print(lcm_list(a))
s275105422
p03633
u934529721
1567903524
Python
Python (3.4.3)
py
Runtime Error
31
3944
241
import math from functools import reduce n = int(input()) a = [int(input()) for i in range(n)] def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) print(lcm_list(a))
s498200619
p03633
u845442154
1567888206
Python
Python (3.4.3)
py
Runtime Error
17
2940
295
t = [] n = input() for i in range(n): t.append(int(input())) def gcd(a,b): if b > a: a = b b = a while b == 1 a = b b = a % b if b == 1: return a ans = t[0] for i in range(1, n): ans = ans * t[i] // gcd(ans, t[i]) print(ans)
s383947849
p03633
u948524308
1567887761
Python
Python (3.4.3)
py
Runtime Error
36
5048
153
from fractions import gcd N=int(input()) T0=int(input()) for i in range(1,N): T=int(input()) g=gcd(T0,T) ans=T0*(T)//g T0=ans print(ans)
s640229109
p03633
u948524308
1567887476
Python
Python (3.4.3)
py
Runtime Error
53
5728
154
import fractions N=int(input()) T0=int(input()) for i in range(1,N): T=int(input()) g=fractions.gcd(T0,T) ans=T0*(T//g) T0=ans print(ans)
s897892552
p03633
u971282165
1567886671
Python
Python (3.4.3)
py
Runtime Error
17
3060
319
def gcd(a,b): for i in range(1000): a,b=b,a%b if b==0: break return a length = int(input()) trues = 1 ans = int(input()) for i in range(length-1): input_val = int(input()) trues = trues*input_val if ans>input_val: ans = gcd(ans,input_val) else: ans = gcd(input_val,ans) print(trues/ans)
s425623352
p03633
u971282165
1567886563
Python
Python (3.4.3)
py
Runtime Error
18
3064
324
def gcd(a,b): for i in range(100000000): a,b=b,a%b if b==0: break return a length = int(input()) trues = 1 ans = int(input()) for i in range(length-1): input_val = int(input()) trues = trues*input_val if ans>input_val: ans = gcd(ans,input_val) else: ans = gcd(input_val,ans) print(trues/...
s474990521
p03633
u866555183
1567886054
Python
Python (3.4.3)
py
Runtime Error
17
3064
285
N=int(input()) T=[] for i in range(N): T.append(int(input())) F=[] for i in range(len(T)): for i in range(1,n**0.5+1): if n%i == 0: F.append(i) if i != n//i: F.append(n//i) m=set(F) S=1 for i in range(len(T)): S=S*(T[i]/m) print(S)
s653998464
p03633
u948524308
1567885574
Python
Python (3.4.3)
py
Runtime Error
35
5048
146
import fractions N=int(input()) T0=int(input()) for i in range(1,N): T=int(input()) ans=T0*(T//fractions.gcd(T0,T)) T0=ans print(ans)
s963056959
p03633
u530844517
1567885476
Python
Python (3.4.3)
py
Runtime Error
73
3952
262
def gcd(a, b): if b == 0: return a return gcd(b, a%b) N = int(input()) t = [] for _ in range(N): t.append(int(input())) lcm = max(t) for i in range(N): if lcm % t[i] != 0: lcm = lcm * t[i] / gcd(lcm, lcm%t[i]) print(int(lcm))
s293334901
p03633
u948524308
1567885397
Python
Python (3.4.3)
py
Runtime Error
35
5048
146
import fractions N=int(input()) T0=int(input()) for i in range(1,N): T=int(input()) ans=(T0*T)//fractions.gcd(T0,T) T0=ans print(ans)