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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s066444209 | p03633 | u186838327 | 1555291876 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3700 | 246 | 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())
ts = [0]*n
for i in range(n):
ts[i] = int(input())
print(lcm_list(ts)) |
s998001256 | p03633 | u380933932 | 1555278648 | Python | Python (3.4.3) | py | Runtime Error | 40 | 5432 | 409 | #d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
#import math
#n=int(input())
#li=input().split()
#S=input()
#lis=list(map(int,input().split()))
import fractions
l=[]
n=int(input())
for i in range(n):
l.append(int(input()))
ans=l[0]
for... |
s546869165 | p03633 | u380933932 | 1555277825 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 380 | #d=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
#import numpy as np
import math
#n=int(input())
#li=input().split()
#S=input()
#lis=list(map(int,input().split()))
l=[]
n=int(input())
for i in range(n):
l.append(int(input()))
ans=l[0]
for i in range(n-1):... |
s776913095 | p03633 | u655975843 | 1555202232 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3316 | 403 | import sys
import math
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())
def lcm(x, y):
return (x * y) // math.gcd(x, y)
n = ni()
t = ni()
if n == 1:
print(t)
else:
... |
s000612470 | p03633 | u728498511 | 1555188315 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 176 | from math import gcd
from functools import reduce
def lcm(x, y):
return x*y // gcd(x, y)
n = int(input())
nums = [int(input()) for _ in range(n)]
print(reduce(lcm, nums)) |
s814042339 | p03633 | u014322467 | 1555140093 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 233 | import math
from functools import reduce
N = int(input())
T = map(int, [input() for _ in range(N)])
def lcm_base(x, y):
return (x * y) // math.gcd(x, y)
def lcm(numbers):
return reduce(lcm_base, numbers, 1)
print(lcm(T))
|
s517914595 | p03633 | u001041019 | 1555130391 | Python | Python (3.4.3) | py | Runtime Error | 73 | 3956 | 273 | def gcd(a,b): #a<=b
if b%a==0:
return a
else:
c=b%a
return gcd(c,a)
x=gcd(8,12)
n=int(input())
li = [int(input()) for i in range(n)]
li.sort()
a=gcd(li[0],li[1])
b=li[0]*li[1]/a
for i in range(n-2):
a=gcd(li[i+2],b)
b=li[i+2]*b/a
b=int(b)
print(b) |
s453556510 | p03633 | u001041019 | 1555129990 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 283 | def gcd(a,b): #a<=b
if b%a==0:
return a
else:
c=b%a
return gcd(c,a)
x=gcd(8,12)
n=int(input())
li = [int(input()) for i in range(n)]
li.sort()
a=gcd(li[0],li[1])
b=li[0]*li[1]/a
c=a
for i in range(n-2):
a=gcd(li[i+2],a)
b=li[i+2]*c/a
c=a
b=int(b)
print(b) |
s685684360 | p03633 | u001041019 | 1555128744 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 207 | import math
n=int(input())
li = [int(input()) for i in range(n)]
li.sort()
a=math.gcd(li[0],li[1])
b=li[0]*li[1]/a
c=a
for i in range(n-2):
a=math.gcd(li[i+2],a)
b=li[i+2]*c/a
c=a
b=int(b)
print(b) |
s558837401 | p03633 | u052499405 | 1555107221 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 169 | import math
n = int(input())
t = []
for i in range(n):
t.append(int(input()))
ans = t[0]
for i in range(1,n):
ans = ans * t[i] // math.gcd(ans, t[i])
print(ans) |
s855186800 | p03633 | u518042385 | 1555100873 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 104 | n=int(input())
t=1
import math
for i in range(n):
j=int(input())
t=t*j//math.gcd(t,j)
print(t)
|
s712271637 | p03633 | u083960235 | 1554868707 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 278 | N=int(input())
def gcd(a,b):
while b:
a,b=b,a%b
return a
def lcm(a,b):
return a*b//gcd(a,b)
T=[]
for i in range(N):
T.append(int(input()))
if N==1:
print(T[0])
else:
a=lcm(T[0],T[1])
for i in range(N):
a=lcm(a,T[i])
print(a)
|
s396914702 | p03633 | u192541825 | 1554681480 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 211 | def gcd(x,y):
if y==0:
return x
else:
return gcd(y,x%y)
n=int(input())
a=int(input())
b=int(input())
x=a*b//gcd(a,b)
for i in range(n-2):
c=int(input())
x=c*x//gcd(c,x)
print(x) |
s117871661 | p03633 | u192541825 | 1554681304 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 217 | def gcd(x,y):
if y==0:
return x
while y!=0:
return gcd(y,x%y)
n=int(input())
a=int(input())
b=int(input())
x=a*b//gcd(a,b)
for i in range(n-2):
c=int(input())
x=c*x//gcd(c,x)
print(x) |
s129895697 | p03633 | u393512980 | 1554502050 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 330 | def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
def lcm(a, b):
return a * b // gcd(a, b)
import sys
input = sys.stdin.readline
N = int(input())
T = [int(input()) for _ in range(N)]
if N == 1:
ans = T[0]
else:
ans = lcm(T[0], T[1])
for i in range(2, N):
ans = lcm(ans, T[i])
... |
s624990149 | p03633 | u393512980 | 1554501950 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 290 | def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
def lcm(a, b):
return a * b // gcd(a, b)
import sys
input = sys.stdin.readline
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) |
s894248979 | p03633 | u393512980 | 1554501449 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 273 | def gcd(a, b):
if b == 0:
return a
return gcd(b, b % a)
import sys
input = sys.stdin.readline
N = int(input())
T = [int(input()) for _ in range(N)]
ans = T[0] * T[1] // gcd(T[0], T[1])
for i in range(2, N):
ans = ans * T[i] // gcd(ans, T[i])
print(ans) |
s132107000 | p03633 | u092926023 | 1554404083 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 354 | n_in = int(input())
l = [int(input()) for i in range(n_in)]
# l = [3, 5, 10, 11]
p = l[0]
for i in range(1, len(l)):
q = l[i]
if p >= q:
m, n = p, q
else:
m, n = q, p
while True:
mod_value = m % n
if mod_value == 0:
break
m = n
n = mod_v... |
s786869100 | p03633 | u092926023 | 1554402952 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 376 | n_in = int(input())
l = [int(input()) for i in range(n_in)]
p = l[0]
for i in range(1, len(l)):
q = l[i]
if p >= q:
m = p
n = q
else:
m = q
n = p
while True:
mod_value = m % n
if mod_value == 0:
n = mod_value
break
m... |
s264748417 | p03633 | u092926023 | 1554402724 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3060 | 350 | n_in = int(input())
l = [int(input()) for i in range(n_in)]
p = l[0]
for i in range(1, len(l)):
q = l[i]
if p >= q:
m = p
n = q
else:
m = q
n = p
while True:
mod_value = m % n
if mod_value == 0:
break
m = n
n = mod_value... |
s678526183 | p03633 | u379692329 | 1554333827 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 251 | 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())
T = [int(input()) for _ in range(N)]
LCM = lcm(T[0], T[1])
for i in range(1, N-1):
LCM = lcm(LCM, T[i+1])
print(LCM) |
s810814474 | p03633 | u013408661 | 1554245088 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 209 | import sys
sys.setrecursionlimit(10**9)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s378267723 | p03633 | u013408661 | 1554244931 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 209 | import sys
sys.setrecursionlimit(10**9)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s835873119 | p03633 | u013408661 | 1554244898 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 210 | import sys
sys.setrecursionlimit(10**18)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s131480545 | p03633 | u013408661 | 1554244870 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 213 | import sys
sys.setrecursionlimit(100000000)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s611303282 | p03633 | u013408661 | 1554244826 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 212 | import sys
sys.setrecursionlimit(10000000)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s283986323 | p03633 | u013408661 | 1554244786 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 210 | import sys
sys.setrecursionlimit(200000)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s636741858 | p03633 | u013408661 | 1554244719 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 210 | import sys
sys.setrecursionlimit(100000)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s453077762 | p03633 | u013408661 | 1554244676 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 208 | import sys
sys.setrecursionlimit(5000)
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s905210459 | p03633 | u013408661 | 1554244576 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 180 | import sys
n=int(input())
t=[int(i) for i in sys.stdin]
def gcd(x,y):
if y==0:
return x
return gcd(y,x%y)
x=t[0]
for i in range(1,n):
y=x*t[i]//gcd(x,t[i])
x=y
print(y) |
s681637658 | p03633 | u639426108 | 1554242627 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 289 | def GCD(A, B):
if B > A:
A, B = B, A
if A%B == 0:
return B
else:
return GCD(B, A%B)
def LCM(A, B):
ans = A/GCD(A,B)*B
return ans
N = int(input())
a_list = [int(input()) for i in range(N)]
f = 1
if N == 1:
print(f)
else:
for i in range(N):
f= int(LCM(f, a_list[i]))
print(f) |
s677782171 | p03633 | u639426108 | 1554242301 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 299 | def GCD(A, B):
if B > A:
A, B = B, A
if A%B == 0:
return B
else:
return GCD(B, A%B)
def LCM(A, B):
ans = A/GCD(A,B)*B
return ans
N = int(input())
a_list = [int(input()) for i in range(N)]
f = a_list[0]
if N == 1:
print(f)
else:
for i in range(1,N):
f= int(LCM(f, a_list[i]))
print(f) |
s322770926 | p03633 | u639426108 | 1554242185 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4004 | 294 | def GCD(A, B):
if B > A:
A, B = B, A
if A%B == 0:
return B
else:
return GCD(B, A%B)
def LCM(A, B):
ans = A/GCD(A,B)*B
return ans
N = int(input())
a_list = [int(input()) for i in range(N)]
f = a_list[0]
if N == 1:
print(f)
else:
for i in range(1,N):
f= LCM(f, a_list[i])
print(f) |
s811445375 | p03633 | u639426108 | 1554239521 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 358 | def GCD(A, B, C, D):
if A%B != 0:
GCD(B, A%B, C, D)
else:
LCM(C, D, B)
def LCM(A, B, C):
ans = A*B/C
return ans
N = int(input())
a_list = [int(input()) for i in range(N)]
if N == 1:
print(a_list[0])
else:
for i in range(N-1):
e = GCD(a_list[0], a_list[1], a_list[0], a_list[1])
a_list.append(e)
a_list.po... |
s444747753 | p03633 | u565204025 | 1554232923 | Python | PyPy3 (2.4.0) | py | Runtime Error | 186 | 38640 | 345 | # -*- coding: utf-8 -*-
def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
n = int(input())
t = [0] * n
for i in range(n):
t[i] = int(input())
answer = t[0] * t[1] / gcd(t[0],t[1])
for i in range(2,n):
answer = answer * t[i] / gcd(int(answer),... |
s855129601 | p03633 | u565204025 | 1554232870 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 321 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
n = int(input())
t = [0] * n
for i in range(n):
t[i] = int(input())
answer = t[0] * t[1] / gcd(t[0],t[1])
for i in range(2,n):
answer = answer * t[i] / gcd(int(answer),t[i])
print(int(answer))... |
s971633183 | p03633 | u565204025 | 1554232834 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 321 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
n = int(input())
t = [0] * n
for i in range(n):
t[i] = int(input())
answer = t[0] * t[1] / gcd(t[0],t[1])
for i in range(2,n):
answer = answer * t[i] / gcd(int(answer),t[i])
print(int(answer))... |
s701064382 | p03633 | u565204025 | 1554232667 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 252 | # -*- coding: utf-8 -*-
import math
n = int(input())
t = [0] * n
for i in range(n):
t[i] = int(input())
answer = t[0] * t[1] / math.gcd(t[0],t[1])
for i in range(2,n):
answer = answer * t[i] / math.gcd(int(answer),t[i])
print(int(answer))
|
s850041971 | p03633 | u565204025 | 1554232630 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 252 | # -*- coding: utf-8 -*-
import math
n = int(input())
t = [0] * n
for i in range(n):
t[i] = int(input())
answer = t[0] * t[1] / math.gcd(t[0],t[1])
for i in range(2,n):
answer = answer * t[i] / math.gcd(int(answer),t[i])
print(int(answer))
|
s388359378 | p03633 | u619458041 | 1554229435 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 393 | import sys
from math import gcd
def lcm(a, b):
return (a * b) // gcd(a, b)
def main():
input = sys.stdin.readline
N = int(input())
T = [int(input()) for _ in range(N)]
T = sorted(T)
t = T[0]
for i in range(N):
if T[i] % t == 0:
t = T[i]
else:
t = l... |
s980111621 | p03633 | u159994501 | 1554217509 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 268 | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b):
return int(a * b / gcd(max(a, b), min(a, b)))
N = int(input())
T = [int(input()) for i in range(N)]
A = T[0]
for i in range(N):
A = lcm(A, T[i])
print(A)
|
s009962781 | p03633 | u159994501 | 1554217066 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 308 | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b):
return int(a * b / gcd(max(a, b), min(a, b)))
N = int(input())
T = [int(input()) for i in range(N)]
if N == 1:
print(T[0])
exit()
A = T[0]
for i in range(1, N):
A = lcm(A, T[i])
print(A)
|
s946742944 | p03633 | u159994501 | 1554216775 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 270 | def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
def lcm(a, b):
return int(a * b / gcd(max(a, b), min(a, b)))
N = int(input())
T = [int(input()) for i in range(N)]
A = T[0]
for i in range(1, N):
A = lcm(A, T[i])
print(A)
|
s350055269 | p03633 | u278260569 | 1554161200 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 219 | import math
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
temp_LCM = T[0]
for i in range(N-1):
temp_GCD = math.gcd(temp_LCM,T[i+1])
temp_LCM = (temp_LCM * T[i+1]) // temp_GCD
print(temp_LCM) |
s733008345 | p03633 | u278260569 | 1554161157 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 217 | import math
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
temp_LCM = T[0]
for i in range(N-1):
temp_GCD = math.gcd(temp_LCM,T[i+1])
temp_LCM = temp_LCM * T[i+1] // temp_GCD
print(temp_LCM) |
s602297365 | p03633 | u278260569 | 1554161108 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 217 | import math
N = int(input())
T = []
for i in range(N):
T.append(int(input()))
temp_LCM = T[0]
for i in range(N-1):
temp_GCD = math.gcd(temp_LCM,T[i+1])
temp_LCM = temp_LCM * T[i+1] // temp_GCD
print(temp_LCM) |
s837300649 | p03633 | u091051505 | 1554155784 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 136 | n = int(input())
a = [1]
for _ in range(n):
a.append(int(input()))
for i in range(1, n+1):
a[i] = lcm(a[i-1], a[i])
print(a[-1]) |
s009543537 | p03633 | u798129018 | 1553906605 | Python | PyPy3 (2.4.0) | py | Runtime Error | 180 | 38512 | 251 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
def lcm(a,b):
return int(a*b/gcd(a,b))
N = int(input())
T = [int(input()) for i in range(N)]
ans = T[0]
for i in T[1:]:
ans = lcm(ans,i)
print(ans) |
s672102876 | p03633 | u798129018 | 1553906307 | Python | PyPy3 (2.4.0) | py | Runtime Error | 347 | 52848 | 239 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
def lcm(a,b):
return float(a*b/gcd(a,b))
N = int(input())
ans = 1
for i in range(N):
t = float(input())
ans = lcm(t,ans)
print(ans) |
s826829961 | p03633 | u798129018 | 1553906165 | Python | PyPy3 (2.4.0) | py | Runtime Error | 167 | 38256 | 237 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
def lcm(a,b):
return int(a*b/gcd(a,b))
N = int(input())
ans = 1
for i in range(N):
t = float(input())
ans = lcm(t,ans)
print(ans) |
s509395839 | p03633 | u798129018 | 1553906121 | Python | PyPy3 (2.4.0) | py | Runtime Error | 166 | 38512 | 235 | def gcd(a, b):
if a < b:
a, b = b, a
if b == 0:
return a
c = a % b
return gcd(b, c)
def lcm(a,b):
return int(a*b/gcd(a,b))
N = int(input())
ans = 1
for i in range(N):
t = int(input())
ans = lcm(t,ans)
print(ans) |
s575216898 | p03633 | u620945921 | 1553905250 | Python | Python (3.4.3) | py | Runtime Error | 80 | 3956 | 434 | #標準入力の読み込み
n=int(input())
x=[int(input()) for i in range(n)]
x.sort(reverse=True)
n=len(x)
#ユークリッド互除法の関数の定義
def gcd(a,b):
if b==0:return a
return gcd(b,a%b)
if n==1:
ans=x[0]
else:
element = x[0]/gcd(x[0], x[1])*x[1]
if n==2:ans=element
else:
for i in range(2,n):
element=e... |
s511452198 | p03633 | u620945921 | 1553905167 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3964 | 366 | n=int(input())
t=[int(input()) for i in range(n)]
#print(n,t)
t.sort(reverse=True)
def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
if n==1:
ans=t
elif n==2:
ans=t[0]/gcd(t[0],t[1])*t[1]
else:
tmp=t[0]/gcd(t[0],t[1])*t[1]
n=2
while n < len(t):
tmp=tmp/gcd(tmp,t[n])... |
s429555531 | p03633 | u620945921 | 1553897936 | Python | Python (3.4.3) | py | Runtime Error | 79 | 3956 | 434 | #標準入力の読み込み
n=int(input())
x=[int(input()) for i in range(n)]
x.sort(reverse=True)
n=len(x)
#ユークリッド互除法の関数の定義
def gcd(a,b):
if b==0:return a
return gcd(b,a%b)
if n==1:
ans=x[0]
else:
element = x[0]*x[1]/gcd(x[0], x[1])
if n==2:ans=element
else:
for i in range(2,n):
element=e... |
s632568160 | p03633 | u285443936 | 1553897811 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 351 | N = int(input())
T = [int(input()) for i in range(N)]
dvs = []
dvs_all = []
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y != 0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
return int(m * n / gcd(m,n))
ans = 1
for i in range(N):
a... |
s214384897 | p03633 | u620945921 | 1553897750 | Python | Python (3.4.3) | py | Runtime Error | 78 | 4060 | 413 | #標準入力の読み込み
n=int(input())
x=[int(input()) for i in range(n)]
n=len(x)
#ユークリッド互除法の関数の定義
def gcd(a,b):
if b==0:return a
return gcd(b,a%b)
if n==1:
ans=x[0]
else:
element = x[0]*x[1]/gcd(x[0], x[1])
if n==2:ans=element
else:
for i in range(2,n):
element=element*x[i]/gcd(eleme... |
s468154643 | p03633 | u285443936 | 1553897212 | Python | Python (3.4.3) | py | Runtime Error | 19 | 3064 | 402 | N = int(input())
T = [int(input()) for i in range(N)]
dvs = []
dvs_all = []
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y != 0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
return int(m * n / gcd(m,n))
if N == 1:
ans = T[0]
else:
... |
s045567341 | p03633 | u285443936 | 1553897059 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 398 | N = int(input())
T = [int(input()) for i in range(N)]
dvs = []
dvs_all = []
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y != 0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
return int(m * n / gcd(m,n))
if N = 1:
ans = T[0]
else:
f... |
s962536266 | p03633 | u285443936 | 1553896934 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 363 | N = int(input())
T = [int(input()) for i in range(N)]
dvs = []
dvs_all = []
def gcd(m,n):
x = max(m,n)
y = min(m,n)
if x%y == 0:
return y
else:
while x%y != 0:
z = x%y
x = y
y = z
else:
return z
def lcm(m,n):
return int(m * n / gcd(m,n))
for i in range(N - 1):
ans = l... |
s200365036 | p03633 | u620945921 | 1553896364 | Python | Python (3.4.3) | py | Runtime Error | 77 | 4064 | 369 | n=int(input())
t=[int(input()) for i in range(n)]
#print(n,t)
t.sort(reverse=True)
def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
if n==1:
ans=t[0]
elif n==2:
ans=t[0]*t[1]/gcd(t[0],t[1])
else:
tmp=t[0]*t[1]/gcd(t[0],t[1])
n=2
while n < len(t):
tmp=tmp*t[n]/gcd(t... |
s855602678 | p03633 | u620945921 | 1553896191 | Python | Python (3.4.3) | py | Runtime Error | 74 | 4028 | 365 | n=int(input())
t=[int(input()) for i in range(n)]
#print(n,t)
t.sort(reverse=True)
def gcd(a,b):
if b==0:
return a
else:
return gcd(b,a%b)
if n==1:
ans=t
elif n==2:
ans=t[0]*t[1]/gcd(t[0],t[1])
else:
tmp=t[0]*t[1]/gcd(t[0],t[1])
n=2
while n < len(t):
tmp=tmp*t[n]/gcd(tmp,... |
s804652983 | p03633 | u315485238 | 1553887730 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 171 | N=int(input())
T = [int(input()) for _ in range(N)]
from functools import reduce
from fraction import gcd
def lcm(a,b):
return a*b //gcd(a,b)
print(reduce(lcm, T))
|
s313734506 | p03633 | u027253287 | 1553881058 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 221 | def gcm(a, b) :
while(b) :
a, b = b, a%b
return a
def lcm(a, b) :
return int(a*b/gcm(a, b))
n = int(input())
a = [int(input()) for _ in range(n)]
for i in range(n-1) :
a[i+1] = lcm(a[i], a[i+1])
print(a[n-1]) |
s476446340 | p03633 | u782654209 | 1553646375 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 173 | import fractions
def lcm(a,b):
return int(a*b/fractions.gcd(a,b))
N=int(input())
T=[int(input()) for i in range(N)]
ans=1
for i in range(N):
ans=lcm(ans,T[i])
print(ans) |
s605611253 | p03633 | u185896732 | 1553628181 | Python | Python (3.4.3) | py | Runtime Error | 36 | 5048 | 145 | from fractions import gcd
def lcm(a,b):
return a*b//gcd(a,b)
n=int(input())
s=1
for i in range(n):
t=int(input())
s=lcm(a,t)
print(s) |
s413082512 | p03633 | u185896732 | 1553628136 | Python | Python (3.4.3) | py | Runtime Error | 42 | 5304 | 136 | from fractions import gcd
def lcm(a,b):
return a*b//gcd(a,b)
n=int(input())
s=1
for i in range(n):
t=int(input())
s=lcm(a,t) |
s138051813 | p03633 | u379692329 | 1553583463 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 139 | import math
N = int(input())
T = [int(input()) for _ in range(N)]
ans = 1
for i in T:
ans = (ans * i) // math.gcd(ans, i)
print(ans) |
s170072295 | p03633 | u379692329 | 1553583378 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 133 | import math
N = int(input())
T = [int(input()) for _ in range(N)]
lcm = 1
for i in T:
lcm = lcm*i//math.gcd(lcm, i)
print(lcm) |
s461676843 | p03633 | u379692329 | 1553582540 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 133 | import math
N = int(input())
T = [int(input()) for _ in range(N)]
LCM = 1
for i in T:
LCM = LCM*i//math.gcd(LCM, i)
print(LCM) |
s869402322 | p03633 | u379692329 | 1553582434 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 133 | import math
N = int(input())
T = [int(input()) for _ in range(N)]
LCM = 1
for i in T:
LCM = LCM*i//math.gcd(LCM, i)
print(LCM) |
s282615007 | p03633 | u650622056 | 1553365469 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 225 | from math import gcd
from functools import reduce
N = int(input())
T = [int(input()) for _ in range(N)]
def lcm(a, b):
return a * b // gcd(a, b)
def lcm_multi(nums):
return reduce(lcm, nums)
print(lcm_multi(T)) |
s577134499 | p03633 | u758649177 | 1553269422 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 137 | # coding: UTF-8
import math
N=int(input())
a=int(input())
for i in range(N-1):
b=int(input())
a=a*b//math.gcd(a, b)
print(int(a)) |
s829427929 | p03633 | u758649177 | 1553269282 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 144 | # coding: UTF-8
import math
N=int(input())
a=int(input())
for i in range(N-1):
b=int(input())
c=math.gcd(a, b)
a=a*b/c
print(int(a)) |
s029707463 | p03633 | u905715926 | 1552526876 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 308 | def gcd(a,b):
a = int(a)
b = int(b)
r = (int)(a%b)
while(r!=0):
a=(int)(b)
b=(int)(r)
r=(int)(a%b)
return b
def lcm(a,b):
return int((a*b)/gcd(a,b))
n = int(input())
ans = int(input())
for i in range(n-1):
num = int(input())
ans = lcm(max(ans,num),min(ans,num))
print(int(ans))
|
s728062703 | p03633 | u905715926 | 1552526739 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 303 | def gcd(a,b):
a = int(a)
b = int(b)
r = (int)(a%b)
while(r!=0):
a=(int)(b)
b=(int)(r)
r=(int)(a%b)
return b
def lcm(a,b):
return (a*b)/gcd(a,b)
n = int(input())
ans = int(input())
for i in range(n-1):
num = int(input())
ans = lcm(max(ans,num),min(ans,num))
print(int(ans))
|
s019057173 | p03633 | u905715926 | 1552526602 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3188 | 277 | def gcd(a,b):
r = (int)(a%b)
while(r!=0):
a=(int)(b)
b=(int)(r)
r=(int)(a%b)
return b
def lcm(a,b):
return (a*b)/gcd(a,b)
n = int(input())
ans = int(input())
for i in range(n-1):
num = int(input())
ans = lcm(max(ans,num),min(ans,num))
print(int(ans))
|
s919299762 | p03633 | u905715926 | 1552526557 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 271 | def gcd(a,b):
r = (int)(a%b)
while(r!=0):
a=(int)b
b=(int)r
r=(int)a%b
return b
def lcm(a,b):
return (a*b)/gcd(a,b)
n = int(input())
ans = int(input())
for i in range(n-1):
num = int(input())
ans = lcm(max(ans,num),min(ans,num))
print(int(ans))
|
s140075813 | p03633 | u905715926 | 1552526144 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 203 | def gcd(a,b):
r = a%b
while(r==0):
a=b
b=r
r=a%b
return b
n = int(input())
ans = int(input())
for i in range(n-1):
num = int(input())
ans = gcd(max(ans,num),min(ans,num))
print(ans) |
s562205816 | p03633 | u634461820 | 1552415820 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 251 | def gcd(x, y):
if y == 0:
return x
else:
return gcd(y, x % y)
N = int(input())
time = [int(input()) for i in range(N)]
tmp = time[0]*time[1]//gcd(time[0],time[1])
for i in time:
if tmp%i!=0:
tmp = tmp*i//gcd(tmp,i)
print(tmp) |
s496975367 | p03633 | u090225501 | 1552232369 | Python | Python (3.4.3) | py | Runtime Error | 23 | 3572 | 243 | from functools import reduce
from math import gcd
def main():
n = int(input())
t = [int(input()) for _ in range(n)]
print(solve(t))
def solve(t):
return reduce(lcm, t, 1)
def lcm(a, b):
return a * b // gcd(a, b)
main()
|
s500363977 | p03633 | u338225045 | 1552167002 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3692 | 273 | import math
import functools
N = int( input() )
T = [ int(input()) for _ in range(N) ]
def lcm( x, y ):
return x * y // math.gcd( x, y )
def lcm_list( numbers ):
return functools.reduce( lcm, numbers, 1 )
if N == 1: print( T[0] )
else : print( lcm_list(T) ) |
s969361622 | p03633 | u952022797 | 1551977056 | Python | Python (3.4.3) | py | Runtime Error | 24 | 3572 | 415 | # -*- coding: utf-8 -*-
import sys
import copy
def main():
num = int(input())
clocks = []
for _ in range(num):
clock = int(input())
clocks.append(clock)
ans = 1
for clock in clocks:
ans = lcm(ans, clock)
print(int(ans))
def gcd(a, b):
if a > b:
a, b = b, a
while a > 0:
a, b = b % a, a
re... |
s721884682 | p03633 | u952022797 | 1551976777 | Python | Python (3.4.3) | py | Runtime Error | 34 | 3956 | 451 | # -*- coding: utf-8 -*-
import sys
import copy
def main():
num = int(input())
clocks = []
for _ in range(num):
clock = int(input())
clocks.append(clock)
ans = clocks[0]
for clock in clocks:
if clock == ans: continue
ans = lcm(ans, clock)
print(int(ans))
def gcd(a, b):
if a > b:
a, b = b, a
... |
s164450683 | p03633 | u209918867 | 1551784187 | Python | Python (3.4.3) | py | Runtime Error | 20 | 3064 | 286 | n=int(input())
arr_Ti = [int(input()) for _ in range(n)]
n=int(input())
arr_Ti = [int(input()) for _ in range(n)]
keep = [max(arr_Ti)]
def prod(arr):
val=1
for n in arr:
val*=n
return val
for num in arr_Ti[::-1]:
if max(arr_Ti)%num!=0:
keep.append(num)
print(prod(keep)) |
s511025142 | p03633 | u882620594 | 1551661488 | Python | Python (3.4.3) | py | Runtime Error | 86 | 12260 | 629 | import sys
sys.setrecursionlimit(10000)
def gcd(a, b):
if b == 1:
return 1
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]* (A[1] // gcd(A[0], A[1]))
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
rec = lcm(A, n-1)
return r... |
s339716174 | p03633 | u882620594 | 1551661129 | Python | Python (3.4.3) | py | Runtime Error | 85 | 12260 | 485 | import sys
sys.setrecursionlimit(10000)
def gcd(a, b):
if b == 1:
return 1
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]* (A[1] // gcd(A[0], A[1]))
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
temp = lcm(A, n-1)
return ... |
s940993608 | p03633 | u882620594 | 1551660897 | Python | Python (3.4.3) | py | Runtime Error | 84 | 12264 | 476 | import sys
sys.setrecursionlimit(10000)
def gcd(a, b):
if b == 1:
return 1
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]* (A[1] // gcd(A[0], A[1]))
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a *... |
s029632881 | p03633 | u882620594 | 1551660655 | Python | Python (3.4.3) | py | Runtime Error | 84 | 12256 | 494 | import sys
sys.setrecursionlimit(10000)
def gcd(a, b):
if b == 1:
return 1
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]*A[1] // gcd(A[0], A[1])
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a* A[n... |
s908520169 | p03633 | u882620594 | 1551660456 | Python | Python (3.4.3) | py | Runtime Error | 78 | 3952 | 453 | def gcd(a, b):
if b == 1:
return 1
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]*A[1] // gcd(A[0], A[1])
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a* A[n-1] // gcd(a, A[n-1])
n = int(input())
a... |
s504637745 | p03633 | u882620594 | 1551660414 | Python | Python (3.4.3) | py | Runtime Error | 77 | 3948 | 455 | def gcd(a, b):
if b == 1:
return 1
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]*A[1] // gcd(A[0], A[1])
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a* A[n-1] // gcd(a, A[n-1])
n = int(input())
a... |
s954344413 | p03633 | u882620594 | 1551659060 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3952 | 481 | def gcd(a, b):
if b == 1:
return 1
# a > b を仮定
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]* (A[1] // gcd(A[0], A[1]))
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a* (A[n-1] // gcd(a, A[n-1])... |
s591327516 | p03633 | u882620594 | 1551658649 | Python | Python (3.4.3) | py | Runtime Error | 78 | 3948 | 475 | def gcd(a, b):
if b == 1:
return 1
# a > b を仮定
r = a % b
if r == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]*A[1] // gcd(A[0], A[1])
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a*A[n-1] // gcd(a, A[n-1])
n =... |
s519558239 | p03633 | u882620594 | 1551658292 | Python | Python (3.4.3) | py | Runtime Error | 75 | 3952 | 494 | def gcd(a, b):
if b == 1:
return 1
# a > b を仮定
r = a // b
mod = a % b
if mod == 0:
return b
else:
return gcd(b, r)
def lcm(A, n):
if n == 2:
return A[0]*A[1] // gcd(A[0], A[1])
#lcm(A, n)はA[0]-A[n-1]までの最小公倍数を求める
a = lcm(A, n-1)
return a*A[n-1] // ... |
s280220747 | p03633 | u175034939 | 1551572264 | Python | Python (3.4.3) | py | Runtime Error | 75 | 4068 | 246 | 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())
a = [int(input()) for _ in range(n)]
b = lcm(a[0],a[1])
for i in range(2,n):
b = lcm(b,a[i])
print(int(b)) |
s245591861 | p03633 | u952708174 | 1551141216 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 233 | def c_multiple_clocks(N, T):
from fractions import gcd
from functools import reduce
return reduce(lambda a, b: (a * b) // gcd(a, b), T)
N = int(input())
T = [int(input()) for _ in range(N)]
print(c_multiple_Clocks(N, T)) |
s494352139 | p03633 | u177756077 | 1551058975 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3316 | 105 | import math
N=int(input())
x=1
for i in range(N):
t=int(input())
x=(x*t)//math.gcd(x,t)
print(x) |
s177409865 | p03633 | u514383727 | 1551015147 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 335 | import sys
sys.setrecursionlimit(200000000)
n = int(input())
if n == 1:
print(t[0])
exit()
# 最大公約数
def gcd(a, b):
if b == 0:
return a
return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
return a * b / gcd(a, b)
res = 1
for i in range(n):
t = int(input())
res = int(lcm(res, t))
print(res) |
s097948536 | p03633 | u514383727 | 1551014645 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 333 | n = int(input())
t = [int(input()) for _ in range(n)]
if n == 1:
print(t[0])
exit()
# 最大公約数
def gcd(a, b):
if b == 0:
return a
return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
return a * b / gcd(a, b)
res = int(lcm(t[0], t[1]))
for i in range(2, n):
res = int(lcm(res, t[i]))
print(res)
|
s993107334 | p03633 | u514383727 | 1551014390 | Python | Python (3.4.3) | py | Runtime Error | 79 | 4004 | 328 | n = int(input())
t = [int(input()) for _ in range(n)]
if n == 1:
print(t[0])
exit()
# 最大公約数
def gcd(a, b):
if b == 0:
return a
return gcd(b, a%b)
# 最小公倍数
def lcm(a, b):
return a * b / gcd(a, b)
res = lcm(t[0], t[1])
for i in range(2, n):
res = lcm(res, t[i])
print(int(res))
|
s118566979 | p03633 | u721316601 | 1550879031 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3060 | 157 | import math
N = int(input())
T = [int(input()) for i in range(N)]
for i in range(1, N):
T[i] = int(T[i] * T[i-1] / math.gcd(T[i], T[i-1]))
print(T[-1]) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.