Submission #1506633


Source Code Expand

Copy
n = int(raw_input())

def gcd(a,b):
    if a > b:
        a,b = b,a
    # a <= b
    while a > 0:
        a,b = b%a, a
    return b

def lcm(a,b):
    g = gcd(a,b)
    return a/g * b

x = 1
for i in range(n):
    ti = int(raw_input())
    x = lcm(x, ti)

print x

Submission Info

Submission Time
Task C - Multiple Clocks
User naoya_t
Language Python2 (2.7.6)
Score 300
Code Size 283 Byte
Status
Exec Time 10 ms
Memory 2568 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt
All 300 / 300 sample_01.txt, sample_02.txt, subtask_1_1.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_2.txt, subtask_1_3.txt, subtask_1_4.txt, subtask_1_5.txt, subtask_1_6.txt, subtask_1_7.txt, subtask_1_8.txt, subtask_1_9.txt
Case Name Status Exec Time Memory
sample_01.txt 10 ms 2568 KB
sample_02.txt 10 ms 2568 KB
subtask_1_1.txt 10 ms 2568 KB
subtask_1_10.txt 10 ms 2568 KB
subtask_1_11.txt 10 ms 2568 KB
subtask_1_12.txt 10 ms 2568 KB
subtask_1_13.txt 10 ms 2568 KB
subtask_1_14.txt 10 ms 2568 KB
subtask_1_15.txt 10 ms 2568 KB
subtask_1_2.txt 10 ms 2568 KB
subtask_1_3.txt 10 ms 2568 KB
subtask_1_4.txt 10 ms 2568 KB
subtask_1_5.txt 10 ms 2568 KB
subtask_1_6.txt 10 ms 2568 KB
subtask_1_7.txt 10 ms 2568 KB
subtask_1_8.txt 10 ms 2568 KB
subtask_1_9.txt 10 ms 2568 KB