Submission #9644090


Source Code Expand

Copy
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from fractions import gcd
from functools import reduce

N,*A = map(int,read().split())

MOD = 10 ** 9 + 7

lcm = reduce(lambda x,y: y//gcd(x,y)*x, A)
lcm %= MOD

coef = sum(pow(x, MOD-2, MOD) for x in A)
answer = lcm * coef % MOD

print(answer)

Submission Info

Submission Time
Task E - Flatten
User maspy
Language Python (3.4.3)
Score 500
Code Size 379 Byte
Status AC
Exec Time 579 ms
Memory 5880 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 3
AC × 18
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 35 ms 5076 KB
hand_02 AC 35 ms 5076 KB
hand_03 AC 35 ms 5076 KB
max_01 AC 318 ms 5880 KB
max_02 AC 579 ms 5880 KB
max_03 AC 76 ms 5880 KB
max_04 AC 75 ms 5880 KB
random_01 AC 38 ms 5076 KB
random_02 AC 136 ms 5624 KB
random_03 AC 142 ms 5624 KB
random_04 AC 49 ms 5112 KB
random_05 AC 210 ms 5752 KB
random_06 AC 87 ms 5368 KB
random_07 AC 43 ms 5112 KB
random_08 AC 38 ms 5076 KB
sample_01 AC 35 ms 5076 KB
sample_02 AC 34 ms 5076 KB
sample_03 AC 35 ms 5076 KB