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
s687168414
p03633
u450339194
1561354445
Python
Python (3.4.3)
py
Runtime Error
18
3060
288
from math import gcd #3.5 def lcm(x, y): return (x * y) // gcd(x, y) nl = lambda: list(map(int, input().split())) sl = lambda: input().split() n = lambda: int(input()) s = lambda: input() N = n() common = n() for i in range(N-1): common = lcm(common, n()) print(common)
s262573445
p03633
u013296940
1561342685
Python
Python (3.4.3)
py
Runtime Error
18
3064
605
#最大公約数を求める def gcd(a,b): #a>bとなるように入れ替え if a < b: tmp = a a = b b = tmp #ユークリッドの互除法 r = a % b while r != 0: a = b b = r r = a % b return b #最小公倍数を求める def lcm(a,b): return int((a*b)/gcd(a,b)) #入力 N = int(input()) T = [] for i in rang...
s596862532
p03633
u641460756
1561220118
Python
Python (3.4.3)
py
Runtime Error
23
3688
226
import math from functools import reduce n=int(input()) t=[int(input()) for i in range(n) ] def lcm_sorce(x,y): return (x*y)//math.gcd(x,y) def lcm_list(list_name): return reduce(lcm_sorce,list_name) print(lcm_list(t))
s034733338
p03633
u641460756
1561219892
Python
Python (3.4.3)
py
Runtime Error
23
3700
226
n=int(input()) t=[int(input()) for i in range(n) ] import math from functools import reduce def lcm_sorce(x,y): return (x*y)//math.gcd(x,y) def lcm_list(list_name): return reduce(lcm_sorce,list_name) print(lcm_list(t))
s814332240
p03633
u981767024
1561214468
Python
Python (3.4.3)
py
Runtime Error
49
5600
258
# 2019/06/22 # AtCoder Beginner Contest 070 - C import fractions def lcm_fgf(a, b): return int(a * b / fractions.gcd(a, b)) # Input n = int(input()) alcm = 1 for i in range(n): wt = int(input()) alcm = lcm_fgf(alcm, wt) # Output print(alcm)
s501840292
p03633
u504562455
1560999116
Python
Python (3.4.3)
py
Runtime Error
18
3060
265
def GCD(a, b): if a < b: a, b = b, a if b == 0: return a else: return GCD(b, a % b) def LCM(a, b): return a * b // GCD(a, b) n = int(input()) a = int(input()) for i in range(n-1): ans = LCM(a, int(input())) print(ans)
s422240989
p03633
u102461423
1560919128
Python
Python (3.4.3)
py
Runtime Error
18
2940
166
N = int(input()) def gcd(a,b): while b: a,b = b,a%b return a answer = 0 for _ in range(N): answer = gcd(answer, int(input()) print(answer)
s473813681
p03633
u518064858
1560899235
Python
Python (3.4.3)
py
Runtime Error
35
5048
176
import fractions as frac n=int(input()) t=[int(input()) for _ in range(n)] x=t[0] ans=t[0] for i in range(1,n): g=frac.gcd(x,t[i]) ans=x*y//g x=ans print(int(ans))
s327371731
p03633
u518064858
1560898434
Python
Python (3.4.3)
py
Runtime Error
2104
5052
229
import fractions as frac n=int(input()) t=[int(input()) for _ in range(n)] t=sorted(set(t)) t1=t[0] if n==1: print(t1) exit() for i in range(1,len(t)): t2=t[i] ans=t1*t2/frac.gcd(t1,t2) t1=ans print(int(ans))
s047160948
p03633
u518064858
1560898385
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
65768
229
import fractions as frac n=int(input()) t=[int(input()) for _ in range(n)] t=sorted(set(t)) t1=t[0] if n==1: print(t1) exit() for i in range(1,len(t)): t2=t[i] ans=t1*t2/frac.gcd(t1,t2) t1=ans print(int(ans))
s322008470
p03633
u518064858
1560897970
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
67284
173
import fractions as frac n=int(input()) t=[int(input()) for _ in range(n)] t1=t[0] for i in range(1,n): t2=t[i] ans=t1*t2/frac.gcd(t1,t2) t1=ans print(int(ans))
s275638682
p03633
u518064858
1560897943
Python
Python (3.4.3)
py
Runtime Error
2104
5308
173
import fractions as frac n=int(input()) t=[int(input()) for _ in range(n)] t1=t[0] for i in range(1,n): t2=t[i] ans=t1*t2/frac.gcd(t1,t2) t1=ans print(int(ans))
s973523930
p03633
u518064858
1560897706
Python
Python (3.4.3)
py
Runtime Error
2104
5048
154
import fractions as frac n=int(input()) t1=int(input()) for i in range(n-1): t2=int(input()) ans=t1*t2/frac.gcd(t1,t2) t1=ans print(int(ans))
s148992167
p03633
u518064858
1560897568
Python
Python (3.4.3)
py
Runtime Error
41
5304
153
import fractions as frac n=int(input()) t1=int(input()) for i in range(n-1): t2=int(input()) ans=t1*t2/frac.gcd(t1,t2) t1=t2 print(int(ans))
s221069996
p03633
u539517139
1560866756
Python
Python (3.4.3)
py
Runtime Error
35
5088
190
from fractions import gcd as g def l(a,b): x=a*b/g(a,b) return int(x) n=int(input()) if n==1: print(int(input())) else: for _ in range(n): t=int(input()) m=l(t,m) print(m)
s033763306
p03633
u539517139
1560865857
Python
Python (3.4.3)
py
Runtime Error
37
5048
232
from fractions import gcd as g def l(a,b): x=a*b/g(a,b) return int(x) n=int(input()) t=[0]*n for _ in range(n): t[_]=int(input()) if n==1: print(t[0]) else: m=l(t[0],t[1]) for i in range(1,n): m=l(t[i],m) print(m)
s055583424
p03633
u539517139
1560865713
Python
Python (3.4.3)
py
Runtime Error
36
5048
195
from fractions import gcd as g def l(a,b): x=a*b/g(a,b) return int(x) n=int(input()) t=[0]*n for _ in range(n): t[_]=int(input()) m=l(t[0],t[1]) for i in range(1,n): m=l(t[i],m) print(m)
s689868305
p03633
u333139319
1560801342
Python
PyPy3 (2.4.0)
py
Runtime Error
288
64112
203
import fractions as frac n = int(input()) t = [] for i in range(n): t.append(int(input())) tmp = t[0] for i in range(1,n): if tmp % t[i] != 0: tmp = int(tmp * t[i] /frac.gcd(tmp,t[i])) print(tmp)
s476627772
p03633
u225627575
1560777507
Python
Python (3.4.3)
py
Runtime Error
17
2940
181
import fraction N = int(input()) T = [0]*N for i in range(N): T[i] = int(input()) lcd = 1 for i in range(N): lcd = int(lcd*T[i] / fraction.gcd(lcd,T[i])) print(lcd)
s661101910
p03633
u225627575
1560776982
Python
Python (3.4.3)
py
Runtime Error
17
3060
172
import math N = int(input()) T = [0]*N for i in range(N): T[i] = int(input()) lcd = 1 for i in range(N): lcd = int(lcd*T[i] / math.gcd(lcd,T[i])) print(lcd)
s363000533
p03633
u222138979
1560480142
Python
Python (3.4.3)
py
Runtime Error
73
3900
277
n = int(input()) time = [] for i in range(n): time.append(int(input())) def gcd(a,b): if a == 0: return b return gcd(b % a, a) def lcm(a,b): return (a*b) / gcd(a,b) ans = time[0] for i in range(0, n): ans = lcm(ans, time[i]) print(int(ans))
s358433358
p03633
u114648678
1560344130
Python
Python (3.4.3)
py
Runtime Error
2103
3064
206
n=int(input()) t=[0]*n for i in range(n): t[i]=int(input()) max_t=max(t) count=0 n=1 while count==0: for i in range(n): if n*max_t%t[i]!=0: n+=1 break else: count+=1 print(n*max_t)
s278674647
p03633
u800780376
1560256345
Python
Python (3.4.3)
py
Runtime Error
35
5048
174
import fractions def lcm(a,b): return (a * b) / fractions.gcd(a, b) N = int(input()) T = [] l = 1 for n in range(N): l = lcm(int(l),int(input())) print(int(l))
s887294297
p03633
u800780376
1560256267
Python
Python (3.4.3)
py
Runtime Error
17
3060
164
import math def lcm(a,b): return (a * b) / math.gcd(a, b) N = int(input()) T = [] l = 1 for n in range(N): l = lcm(int(l),int(input())) print(int(l))
s170802457
p03633
u770077083
1560139627
Python
Python (3.4.3)
py
Runtime Error
23
3572
246
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) n = int(input()) ns = [] for _ in range(n): ns.append(int(input())) print(lcm(ns))
s497216885
p03633
u498620941
1560100095
Python
Python (3.4.3)
py
Runtime Error
18
3064
586
N=int(input()) para = [int(input()) for i in range(N)] para.sort(reverse=True) """ 全ての最小公倍数を求めたら良い lcm(a,b,c...) = lcm(a,lcm(b,c.......)) gcd(a,b,c...) = gcd(a,gcd(b,c,d....)) """ """ 最大公倍数の実装 ユークリッドの互除法 a = b*c + d c = d*e + f """ def gcd(a,b): if b == 0 : return a return gcd(b,a%b) def lcm(a,b) ...
s281137497
p03633
u498620941
1560100003
Python
Python (3.4.3)
py
Runtime Error
18
3064
359
N=int(input()) para = [int(input()) for i in range(N)] para.sort(reverse=True) import sys sys.setrecursionlimit(100000) def gcd(a,b): if b == 0 : return a return gcd(b,a%b) def lcm(a,b) : return a*b//gcd(a,b) for i in range(N-1,0,-1): if i == N-1: p = lcm(para[i-1],para[i]) els...
s809602310
p03633
u498620941
1560099899
Python
Python (3.4.3)
py
Runtime Error
17
3064
538
N=int(input()) para = [int(input()) for i in range(N)] para.sort(reverse=True) """ 全ての最小公倍数を求めたら良い lcm(a,b,c...) = lcm(a,lcm(b,c.......)) gcd(a,b,c...) = gcd(a,gcd(b,c,d....)) """ """ 最大公倍数の実装 ユークリッドの互除法 a = b*c + d c = d*e + f """ def gcd(a,b): if b == 0 : return a return gcd(b,a%b) def lcm(a,b) ...
s748483885
p03633
u305781333
1559965563
Python
Python (3.4.3)
py
Runtime Error
22
3700
237
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 _ in range(N)] print(lcm_list(T))
s884368464
p03633
u239316561
1559963099
Python
Python (3.4.3)
py
Runtime Error
17
3060
216
n = int(input()) ans = int(input()) def gcd(a,b): while b: a,b = b,a%b return a def lcm(x,y): return (x*y//gcd(x,y)) for i in range(N-1): t = int(input()) ans = lcm(ans,t) print(ans)
s893884773
p03633
u239316561
1559962887
Python
Python (3.4.3)
py
Runtime Error
74
4052
234
def gcd(num1,num2): if num2 == 0: return num1 return gcd(num2,num1%num2) n = int(input()) t = [] for i in range(n): t.append(int(input())) time = 1 for i in t: time = time * i / gcd(time,i) print(int(time))
s492073357
p03633
u239316561
1559962559
Python
Python (3.4.3)
py
Runtime Error
73
3948
234
def gcd(num1,num2): if num2 == 0: return num1 return gcd(num2,num1%num2) n = int(input()) t = [] for i in range(n): t.append(int(input())) time = 1 for i in t: time = time * i / gcd(time,i) print(int(time))
s746883225
p03633
u239316561
1559962518
Python
Python (3.4.3)
py
Runtime Error
73
3948
229
def gcd(num1,num2): if num2 == 0: return num1 return gcd(num2,num1%num2) n = int(input()) t = [] for i in range(n): t.append(int(input())) time = 1 for i in t: time = time * i / gcd(time,i) print(time)
s736546976
p03633
u239316561
1559959365
Python
Python (3.4.3)
py
Runtime Error
18
2940
306
def gcd(num1,num2):#ユークリッド互除法を関数化 if num2 == 0: return num1 return gcd(num2,num1%num2) n = int(input()) t = [int(x) for x in input()] time = 1 for i in t:#最大公約数を求める。 積を最小公倍数で割ればよい time = time * t // gcd(time,i)
s538231520
p03633
u573970531
1559763799
Python
Python (3.4.3)
py
Runtime Error
36
5048
203
import fractions n=int(input()) t=[] for i in range(n): t.append(int(input())) ans=t[0]*t[1]//(fractions.gcd(t[0],t[1])) for i in range(2,n): ans=ans*t[i]//(fractions.gcd(ans,t[i])) print(ans)
s084271542
p03633
u172035535
1559760309
Python
Python (3.4.3)
py
Runtime Error
75
3976
366
def gcd(a,b,cur): if cur % a == 0 and cur % b == 0: return cur return gcd(a,b,cur+a) n = int(input()) T = [int(input()) for _ in range(n)] while len(T) != 1: if len(T)%2 == 1: T.append(1) new_T = [] for i in range(0,len(T),2): t1,t2 = T[i],T[i+1] a = max(t1,t2) b = min(t1,t2) res = gcd(a,b,a) new_...
s730670822
p03633
u864453204
1559759171
Python
Python (3.4.3)
py
Runtime Error
18
2940
170
from math import gcd def lcm(a, b): return a * b // gcd(a, b) n = int(input()) g = int(input()) for _ in range(n-1): t = int(input()) g = lcm(g, t) print(g)
s336299446
p03633
u239316561
1559709949
Python
Python (3.4.3)
py
Runtime Error
20
3064
328
def gcd (num1,num2): tmp = max(num1,num2) % min(num1,num2) if tmp == 0: return min(num1,num2) return gcd(min(num1,num2),tmp) n = int(input()) t = [] stock = [1] for i in range(n): t.append(int(input())) for i in range(len(t)-1): stock.append(int(t[i+1] / gcd(stock[i],t[i])*t[i])) print(st...
s881647729
p03633
u239316561
1559688750
Python
Python (3.4.3)
py
Runtime Error
17
3064
320
def gcd (num1,num2): tmp = max(num1,num2) % min(num1,num2) if tmp == 0: return min(num1,num2) return gcd(min(num1,num2),tmp) n = int(input()) t = [] stock = [1] for i in range(n): t.append(input()) for i in range(len(t)-1): stock.append(t[i] * t[i+1] / gcd(stock[i],t[i])) print(stock[-1])
s335315990
p03633
u239316561
1559688478
Python
Python (3.4.3)
py
Runtime Error
17
3064
389
def gcd (num1,num2):#ユークリッド互除法 tmp = max(num1,num2) % min(num1,num2) if tmp == 0: return min(num1,num2) return gcd(min(num1,num2),tmp) n = int(input()) t = [] stock = [1] for i in range(n): t.append(input()) for i in range(len(t)-1):#各秒数の最大公倍数を求める stock.append(t[i] * t[i+1] / gcd(stock[i]...
s349757548
p03633
u381739460
1559224741
Python
Python (3.4.3)
py
Runtime Error
17
3060
174
import math n = int(input()) t = [int(input()) for i in range(n)] def lcm(x, y): return (x * y) // math.gcd(x, y) l = t[0] for x in range(n): l = lcm(l,t[x]) print(l)
s781642252
p03633
u497596438
1559186094
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38640
106
N=int(input()) T=1 for i in range(N): T1=int(input()) t=gcd(T,T1) T=(T1//t)*(T//t)*t print(T)
s320954952
p03633
u267300160
1559074611
Python
Python (3.4.3)
py
Runtime Error
18
3060
218
N = int(input()) ans = int(input()) def gcd(a,b): while b: a,b = b,a%b return a def lcm(x,y): return (int(x*y/gcd(x,y))) for i in range(N-1): t = int(input()) ans = lcm(ans,t) print(ans)
s294255138
p03633
u267300160
1559074470
Python
Python (3.4.3)
py
Runtime Error
18
2940
196
N = int(input()) ans = 1 def gcd(a,b): while b: a,b = b,a%b return a def lcm(x,y): return (int(x*y/gcd(x,y))) for i in range(N): ans = lcm(ans,int(input())) print(ans)
s271704076
p03633
u267300160
1559073910
Python
Python (3.4.3)
py
Runtime Error
39
5304
162
import fractions N = int(input()) ans = 1 def lcm(x,y): return (int(x*y/fractions.gcd(x,y))) for i in range(N): ans = lcm(ans,int(input())) print(ans)
s024111096
p03633
u463655976
1558781234
Python
Python (3.4.3)
py
Runtime Error
74
3948
175
N = int(input()) def gcd(x, y): if y == 0: return x else: return gcd(y, x % y) g = 1 for x in (int(input()) for _ in range(N)): g = g * x / gcd(g, x) print(g)
s311250559
p03633
u463655976
1558780938
Python
Python (3.4.3)
py
Runtime Error
17
2940
172
N = int(input()) def gcd(x, y): if y == 0: return x else: return gcd(y, x % y) g = 0 for x in (map(int, input()) for _ in range(N)): g = gcd(g, x) print(g)
s071704421
p03633
u126823513
1558410594
Python
Python (3.4.3)
py
Runtime Error
18
3060
255
import math n = int(input()) li_t = list() for _ in range(n): li_t.append(int(input())) # a * b = 最小公倍数 * 最大公約数 def lcm(a, b): return (a * b) // math.gcd(a, b) work = 1 for t in li_t: work = lcm(work, t) print(work)
s236658975
p03633
u126823513
1558410277
Python
Python (3.4.3)
py
Runtime Error
18
3060
266
import math n = int(input()) li_t = list() for _ in range(n): li_t.append(int(input())) # a * b = 最小公倍数 * 最大公約数 def lcm(a, b): return (a * b) // math.gcd(a, b) work = li_t.pop(0) for t in li_t: work = lcm(work, t) print(work)
s455576137
p03633
u126823513
1558409724
Python
Python (3.4.3)
py
Runtime Error
17
3060
265
import math n = int(input()) li_t = list() for _ in range(n): li_t.append(int(input())) # a * b = 最小公倍数 * 最大公約数 def lcm(a, b): return (a * b) // math.gcd(a, b) work = li_t.pop(0) for t in li_t: work = lcm(work, t) print(work)
s207198047
p03633
u123824541
1558276359
Python
Python (3.4.3)
py
Runtime Error
18
3060
225
N = int(input()) T = [] for i in range(N): T.append(int(input())) a = 1 def gcd(a,b): if b == 0: return a return gcd(b,a%b) for i in range(N): d = gcd(a, T[i]) a = int(a * T[i] / d) print(a)
s843554830
p03633
u123824541
1558276272
Python
Python (3.4.3)
py
Runtime Error
18
3060
241
N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort a = T[0] def gcd(a,b): if b == 0: return a return gcd(b,a%b) for i in range(N-1): d = gcd(a, T[i+1]) a = int(a * T[i+1] / d) print(a)
s943261091
p03633
u123824541
1558276119
Python
Python (3.4.3)
py
Runtime Error
18
3188
318
N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort a = T[0] def gcd(a,b): if b == 0: return a else: c = a % b a = max(b,c) b = min(b,c) return gcd(a,b) for i in range(N-1): d = gcd(a, T[i+1]) a = int(a * T[i+1] / d) print(int(a))
s837673469
p03633
u123824541
1558275663
Python
Python (3.4.3)
py
Runtime Error
36
5048
209
import fractions N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort a = T[0] for i in range(N-1): gcd = fractions.gcd(a, T[i+1]) a = int(a * T[i+1] / gcd) print(int(a))
s492887411
p03633
u123824541
1558275505
Python
Python (3.4.3)
py
Runtime Error
35
5048
216
import math import fractions N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort a = T[0] for i in range(N-1): gcd = math.gcd(a, T[i+1]) a = int(a * T[i+1] / gcd) print(int(a))
s866055895
p03633
u123824541
1558275347
Python
Python (3.4.3)
py
Runtime Error
17
3060
199
import math N = int(input()) T = [] for i in range(N): T.append(int(input())) T.sort a = T[0] for i in range(N-1): gcd = math.gcd(a, T[i+1]) a = int(a * T[i+1] / gcd) print(int(a))
s338871368
p03633
u693953100
1558039113
Python
PyPy3 (2.4.0)
py
Runtime Error
355
53744
185
def gcd(a,b): if b==0: return a return gcd(b,a%b) n = int(input()) ans = 1 l = [int(input()) for i in range(n)] for i in l: ans = ans*i/gcd(ans,i) print(int(ans))
s572001775
p03633
u665038048
1557719354
Python
Python (3.4.3)
py
Runtime Error
38
5304
235
from fractions import gcd N = int(input()) T = [0]*N for i in range(N): T[i] = int(input()) def lcm(a, b): return int((a*b)/gcd(a, b)) lcm_ans = lcm(T[0], T[1]) for i in range(N): lcm_ans = lcm(T[i], lcm_ans) print(lcm_ans)
s531512294
p03633
u941438707
1557590673
Python
Python (3.4.3)
py
Runtime Error
24
3700
314
n=int(input()) t=[0]*n allmultiple=1 for i in range(n): t[i]=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) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) print(lcm(*t))
s328284049
p03633
u055941944
1556775746
Python
Python (3.4.3)
py
Runtime Error
18
2940
165
n=int(input()) x=[] for i in range(n): t=int(input()) x.append(t) ans=x[0] for j in range(1,len(x)): ans=ans*x[j]//fractions.gcd(ans,x[j]) print(ans)
s007436070
p03633
u655834330
1556753999
Python
PyPy3 (2.4.0)
py
Runtime Error
189
39792
569
def read_input(): n = int(input()) tlist = [] for i in range(n): tlist.append(int(input())) return n, tlist gcdmemo = {} def mygcd(a, b): if b == 0: return a if not (a, b) in gcdmemo.keys(): gcdmemo[(a, b)] = mygcd(b, a % b) return gcdmemo[(a, b)] def mylcm(a...
s670866713
p03633
u655834330
1556753721
Python
Python (3.4.3)
py
Runtime Error
18
3064
437
def read_input(): n = int(input()) tlist = [] for i in range(n): tlist.append(int(input())) return n, tlist def mygcd(a, b): if b == 0: return a return mygcd(b, a % b) def mylcm(a, b): g = mygcd(a, b) return int(a * b / g) def submit(): n, tlist = read_input() ...
s713196567
p03633
u655834330
1556753615
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38640
437
def read_input(): n = int(input()) tlist = [] for i in range(n): tlist.append(int(input())) return n, tlist def mygcd(a, b): if b == 0: return a return mygcd(b, a % b) def mylcm(a, b): g = mygcd(a, b) return int(a * b / g) def submit(): n, tlist = read_input() ...
s255936232
p03633
u221345507
1556737308
Python
Python (3.4.3)
py
Runtime Error
17
3060
161
N = int(input()) T_before =int(input()) for i in range(1,N): T =int(input()) f=fractions.gcd(T,T_before) T_before=T*T_before//f print(T_before)
s353772309
p03633
u465101448
1556658802
Python
Python (3.4.3)
py
Runtime Error
18
3064
351
def gcd(a,b): x=int(max(a,b)) y=int(min(a,b)) if x%y==0: return y else: while x%y!=0: z=x%y x=y y=z else: return z def lcm(a,b): return int(a*b/gcd(a,b)) N=int(input()) a=int(input()) for n in range(1,N): b=int(i...
s022365864
p03633
u465101448
1556658360
Python
Python (3.4.3)
py
Runtime Error
18
3060
341
def gcd(a,b): x=max(a,b) y=min(a,b) if x%y==0: return y else: while x%y!=0: z=x%y x=y y=z else: return z def lcm(a,b): return int(a*b/gcd(a,b)) N=int(input()) a=int(input()) for n in range(1,N): b=int(input()) ...
s249337339
p03633
u486448566
1556657899
Python
PyPy3 (2.4.0)
py
Runtime Error
305
65004
621
# 入力 input_int = lambda:int(input()) input_ints = lambda:map(int,input().split()) input_str = lambda:input() input_strs = lambda:input().split() input_lines = lambda n,f:[f() for _ in range(n)] import functools,fractions import numpy as np gcd = lambda a:functools.reduce(fractions.gcd,a) # 最大公約数(リスト) lcm_base = lambda...
s449660070
p03633
u041075929
1556570997
Python
Python (3.4.3)
py
Runtime Error
18
2940
544
// Created by sz #include <bits/stdc++.h> using namespace std; const int N = 1e5 + 5; int n; long long a[N]; long long gcd(long long a, long long b){ return b ? gcd(b, a % b) : a; } int main(){ #ifdef LOCAL freopen("./input.txt", "r", stdin); #endif ios_base::sync_with_stdio(false); cin.tie(0); ...
s306381252
p03633
u807028974
1556339632
Python
Python (3.4.3)
py
Runtime Error
73
3948
241
def gcd(a,b): if a % b == 0: return b else: 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))
s867600656
p03633
u603745966
1556244171
Python
Python (3.4.3)
py
Runtime Error
25
3572
1583
from functools import reduce import math def lcm_base(x, y): return (x * y) // math.gcd(x, y) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) def main(): # 文字列の2進数を数値にする # '101' → '5' # 文字列の頭に'0b'をつけてint()にわたす # binary = int('0b'+'101',0) # 2進数で立っているbitを数える # 101(0x5) → 2 ...
s815339705
p03633
u507617429
1556141630
Python
Python (3.4.3)
py
Runtime Error
73
3956
263
def gcd(a, b): if(b == 0): return a return gcd(b, a % b) def lcm(a, b): return a * b / gcd(a, b) N = int(input()) T = [int(input()) for i in range(N)] ans = max(T) for i in range(N): if ans % T[i] != 0: ans = lcm(ans, T[i]) print(int(ans))
s539166078
p03633
u059210959
1555968666
Python
Python (3.4.3)
py
Runtime Error
27
3828
294
# encoding:utf-8 import copy import random import bisect #bisect_left これで二部探索の大小検索が行える import math N = int(input()) T = [int(input()) for i in range(N)] def lcm(a,b): return (a * b) // math.gcd(a,b) ans = 1 for t in T: ans = lcm(ans,t) print(ans)
s674424089
p03633
u059210959
1555968411
Python
Python (3.4.3)
py
Runtime Error
26
3828
325
# encoding:utf-8 import copy import random import bisect #bisect_left これで二部探索の大小検索が行える import math N = int(input()) T = [0 for i in range(N)] for i in range(N): T[i] = int(input()) def lcm(a,b): return (a * b) // math.gcd(a,b) ans = 1 for t in T: ans = lcm(ans,t) print(ans)
s967739750
p03633
u059210959
1555968341
Python
Python (3.4.3)
py
Runtime Error
28
3828
325
# encoding:utf-8 import copy import random import bisect #bisect_left これで二部探索の大小検索が行える import math N = int(input()) T = [0 for i in range(N)] for i in range(N): T[i] = int(input()) def lcm(a,b): return (a * b) // math.gcd(a,b) ans = 1 for t in T: ans = lcm(ans,t) print(ans)
s314792198
p03633
u249447366
1555956103
Python
Python (3.4.3)
py
Runtime Error
19
3060
183
import math def lcm(a, b): return a * b // math.gcd(a, b) N = int(input()) T = [int(input()) for _ in range(N)] tmp = 1 for i in range(N): tmp = lcm(tmp, T[i]) print(tmp)
s067690358
p03633
u037430802
1555677909
Python
Python (3.4.3)
py
Runtime Error
23
3572
319
import math from functools import reduce #最小公倍数を求める関数 def lcm(x, y): #return x*y // math.gcd(x, y) #gcdは最大公約数を求める return math.floor(x*y / math.gcd(x, y)) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) ans = reduce(lcm, nums) print(ans)
s720546374
p03633
u037430802
1555677847
Python
Python (3.4.3)
py
Runtime Error
23
3572
383
import math from functools import reduce #最小公倍数を求める関数 def lcm_base(x, y): #return x*y // math.gcd(x, y) #gcdは最大公約数を求める return math.floor(x*y / math.gcd(x, y)) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) ans = lcm_...
s353459166
p03633
u037430802
1555677669
Python
Python (3.4.3)
py
Runtime Error
23
3572
371
import math from functools import reduce #最小公倍数を求める関数 def lcm_base(x, y): #return x*y // math.gcd(x, y) #gcdは最大公約数を求める return math.floor(x*y / math.gcd(x, y)) def lcm_list(numbers): return reduce(lcm_base, numbers) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) print(lcm_li...
s294775930
p03633
u037430802
1555677644
Python
Python (3.4.3)
py
Runtime Error
23
3572
381
import math from functools import reduce #最小公倍数を求める関数 def lcm_base(x, y): #return x*y // math.gcd(x, y) #gcdは最大公約数を求める return math.floor(x*y / math.gcd(x, y)) def lcm_list(numbers): return functools.reduce(lcm_base, numbers) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) pr...
s901927114
p03633
u037430802
1555677576
Python
Python (3.4.3)
py
Runtime Error
23
3572
384
import math from functools import reduce #最小公倍数を求める関数 def lcm_base(x, y): #return x*y // math.gcd(x, y) #gcdは最大公約数を求める return math.floor(x*y / math.gcd(x, y)) def lcm_list(numbers): return functools.reduce(lcm_base, numbers, 1) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) ...
s236947763
p03633
u037430802
1555677323
Python
Python (3.4.3)
py
Runtime Error
24
3692
276
import math from functools import reduce def lcm_base(x, y): return math.floor(x*y / math.gcd(x, y)) def lcm_list(numbers): return reduce(lcm_base, numbers, 1) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) print(lcm_list(nums))
s011654777
p03633
u037430802
1555677193
Python
Python (3.4.3)
py
Runtime Error
23
3572
262
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()) nums = [] for i in range(n): nums.append(int(input())) print(lcm_list(nums))
s541290822
p03633
u037430802
1555677032
Python
Python (3.4.3)
py
Runtime Error
22
3572
331
import math from functools import reduce #採用公倍数を求める関数 def lcm_base(x, y): return x*y // math.gcd(x, y) #gcdは最大公約数を求める def lcm_list(numbers): return reduce(lcm_base, numbers, 1) n = int(input()) nums = [] for i in range(n): nums.append(int(input())) print(lcm_list(nums))
s863871748
p03633
u037430802
1555676857
Python
Python (3.4.3)
py
Runtime Error
23
3572
329
import math from functools import reduce n = int(input()) nums = [] for i in range(n): nums.append(int(input())) #採用公倍数を求める関数 def lcm_base(x, y): return x*y // math.gcd(x, y) #gcdは最大公約数を求める def lcm_list(numbers): return reduce(lcm_base, numbers, 1) print(lcm_list(nums))
s985481056
p03633
u767664985
1555660226
Python
Python (3.4.3)
py
Runtime Error
42
5472
164
import fractions N = int(input()) T = list(map(int, input().split())) ans = T[0] for i in range(1, N): ans = ans * T[i] // fractions.grid(ans, T[i]) print(ans)
s685139485
p03633
u885899351
1555618463
Python
Python (3.4.3)
py
Runtime Error
18
3060
161
import math n=int(input()) a=[] for i in range(n):a.append(int(input())) while len(a)>1: j=a.pop() k=a.pop() a.append(j*k//math.gcd(j,k)) print(a[0])
s398323900
p03633
u698176039
1555531397
Python
Python (3.4.3)
py
Runtime Error
20
3064
311
N = int(input()) T = [int(input()) for _ in range(N)] def GCD(a,b): x1 = max(a,b) x2 = min(a,b) x3 = x1 % x2 if x3 == 0: return x2 N = GCD(x2,x3) return N ans = T[0] tmp = ans for i in range(1,N): ans = tmp * T[i] / GCD(tmp,T[i]) tmp = ans print(int(ans))
s743791223
p03633
u698176039
1555531280
Python
Python (3.4.3)
py
Runtime Error
18
3060
315
N = int(input()) T = [int(input()) for _ in range(N)] def GCD(a,b): x1 = max(a,b) x2 = min(a,b) x3 = x1 % x2 if x3 == 0: return x2 else: return GCD(x2,x3) ans = T[0] tmp = ans for i in range(1,N): ans = tmp * T[i] / GCD(tmp,T[i]) tmp = ans print(int(ans))
s173098864
p03633
u698176039
1555530848
Python
Python (3.4.3)
py
Runtime Error
18
3060
291
N = int(input()) T = [int(input()) for _ in range(N)] def GCD(a,b): x1 = max(a,b) x2 = min(a,b) x3 = x1 % x2 if x3 == 0: return x2 else: return GCD(x2,x3) ans = T[0] for i in range(1,N): ans = ans * T[i] / GCD(ans,T[i]) print(int(ans))
s377372320
p03633
u001041019
1555518558
Python
Python (3.4.3)
py
Runtime Error
76
3964
345
a=int(input()) li = [int(input()) for i in range(a)] li.sort() def gcd(x,y): #x<=y if x==y: return x else: if y%x==0: return x else: return gcd(y%x,x) def lcm(x,y): return x*y/gcd(x,y) ans=li[0] for i in range(a-1): if ans<=li[i+1]: ans=lcm(ans,li[i+1]) else: ans=lcm(li[i...
s779913225
p03633
u001041019
1555518118
Python
Python (3.4.3)
py
Runtime Error
75
3904
291
a=int(input()) li = [int(input()) for i in range(a)] li.sort() def gcm(x,y): #x<=y if x==y: return x else: if y%x==0: return x else: return gcm(y%x,x) def lcm(x,y): return x*y/gcm(x,y) ans=li[0] for i in range(a-1): ans=lcm(ans,li[i+1]) print(int(ans))
s766816799
p03633
u827202523
1555457195
Python
Python (3.4.3)
py
Runtime Error
17
3060
167
import math def lcm(x, y): return math.gcd(x, y) n = int(input()) ans = int(input()) for i in range(n-1): tmp = int(input()) ans = lcm(ans,tmp) print(ans)
s716646693
p03633
u827202523
1555456950
Python
Python (3.4.3)
py
Runtime Error
17
3056
213
# coding: utf-8 # Your code here! import math def lcm(x, y): return (x * y) // math.gcd(x, y) n = int(input()) ans = int(input()) for i in range(n-1): tmp = int(input()) ans = lcm(ans,tmp) print(ans)
s291145528
p03633
u827202523
1555456888
Python
Python (3.4.3)
py
Runtime Error
17
3060
171
import math def lcm(x, y): return (x * y) // math.gcd(x, y) n = int(input) ans = int(input) for i in range(n-1): tmp = int(input) ans = lcm(ans,tmp) print(ans)
s474199634
p03633
u827202523
1555456852
Python
Python (3.4.3)
py
Runtime Error
17
2940
159
def lcm(x, y): return (x * y) // math.gcd(x, y) n = int(input) ans = int(input) for i in range(n-1): tmp = int(input) ans = lcm(ans,tmp) print(ans)
s315346660
p03633
u268516119
1555454429
Python
Python (3.4.3)
py
Runtime Error
17
3064
153
from math import gcd def lcm(a,b): return(a*b//gcd(a,b)) N=int(input()) curlcm=1 for _ in range(N): curlcm=lcm(curlcm,int(input())) print(curlcm)
s178027130
p03633
u338225045
1555381577
Python
Python (3.4.3)
py
Runtime Error
17
3064
430
N = int( input() ) T = [ int( input() ) for _ in range(N) ] # 最小公倍数を求めたい # aとbの最小公倍数 = a*b / aとbの最大公約数 # 最大公約数 (Greatest Common Divisor) def GCD( a, b ): if b == 0: return a return GCD(b, a%b) # 最小公倍数 (Least Common Multiple) def LCM( a, b ): return a*b // GCD(a,b) ans = LCM( T[0], T[1] ) for i in range...
s619056283
p03633
u338225045
1555381305
Python
Python (3.4.3)
py
Runtime Error
17
3064
435
N = int( input() ) T = [ int( input() ) for _ in range(N) ] # 最小公倍数を求めたい # aとbの最小公倍数 = a*b / aとbの最大公約数 # 最大公約数 (Greatest Common Divisor) def GCD( a, b ): if b == 0: return a return GCD(b, a%b) # 最小公倍数 (Least Common Multiple) def LCM( a, b ): return a*b // GCD(a,b) ans = LCM( T[0], T[1] ) for i in range...
s395014892
p03633
u338225045
1555380905
Python
Python (3.4.3)
py
Runtime Error
77
3956
438
N = int( input() ) T = [ int( input() ) for _ in range(N) ] # 最小公倍数を求めたい # aとbの最小公倍数 = a*b / aとbの最大公約数 # 最大公約数 (Greatest Common Divisor) def GCD( a, b ): if b == 0: return a return GCD(b, a%b) # 最小公倍数 (Least Common Multiple) def LCM( a, b ): return a*b / GCD(a,b) ans = LCM( T[0], T[1] ) for i in range(...
s039487693
p03633
u338225045
1555380773
Python
Python (3.4.3)
py
Runtime Error
78
3952
433
N = int( input() ) T = [ int( input() ) for _ in range(N) ] # 最小公倍数を求めたい # aとbの最小公倍数 = a*b / aとbの最大公約数 # 最大公約数 (Greatest Common Divisor) def GCD( a, b ): if b == 0: return a return GCD(b, a%b) # 最小公倍数 (Least Common Multiple) def LCM( a, b ): return a*b / GCD(a,b) ans = LCM( T[0], T[1] ) for i in range(...