Submission #9629962


Source Code Expand

from math import *
n = int(input())
a = list(map(int, input().split()))
#print(a)
b=[]
for i in range(n):
    #print(i)
    b.append(a[i])
for i in range(n):
    if i != 0:
        b[i]=int(b[i-1]/int(gcd(b[i-1],b[i])))*b[i]
lcm=b[n-1]
ans=0
for i in range(n):
    #print(a[i])
    ans=(ans+lcm/a[i])%(10**9+7)
print(int(ans))

Submission Info

Submission Time
Task E - Flatten
User AkiShizuha
Language Python (3.4.3)
Score 0
Code Size 344 Byte
Status RE
Exec Time 22 ms
Memory 4084 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
RE × 3
AC × 2
RE × 16
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All hand_01, hand_02, hand_03, max_01, max_02, max_03, max_04, random_01, random_02, random_03, random_04, random_05, random_06, random_07, random_08, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_01 AC 18 ms 3064 KiB
hand_02 AC 18 ms 3064 KiB
hand_03 RE 17 ms 3060 KiB
max_01 RE 21 ms 4084 KiB
max_02 RE 21 ms 4084 KiB
max_03 RE 22 ms 4084 KiB
max_04 RE 21 ms 4084 KiB
random_01 RE 17 ms 3064 KiB
random_02 RE 19 ms 3700 KiB
random_03 RE 20 ms 3700 KiB
random_04 RE 18 ms 3188 KiB
random_05 RE 20 ms 3956 KiB
random_06 RE 19 ms 3444 KiB
random_07 RE 18 ms 3064 KiB
random_08 RE 18 ms 3064 KiB
sample_01 RE 17 ms 3064 KiB
sample_02 RE 17 ms 3064 KiB
sample_03 RE 17 ms 3064 KiB