Submission #9642543


Source Code Expand

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

from fractions import gcd

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

lcm = 1
answer = 0
for x in A:
  n = x//gcd(lcm,x)
  lcm *= n
  answer *= n
  answer += lcm//x
  
answer %= (10**9 + 7)
print(answer)

Submission Info

Submission Time
Task E - Flatten
User maspy
Language Python3 (3.4.3)
Score 500
Code Size 251 Byte
Status
Exec Time 1081 ms
Memory 5984 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01, sample_02, sample_03
All 500 / 500 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 35 ms 5048 KB
hand_02 35 ms 5048 KB
hand_03 35 ms 5048 KB
max_01 543 ms 5984 KB
max_02 1081 ms 5984 KB
max_03 48 ms 5984 KB
max_04 44 ms 5856 KB
random_01 37 ms 5088 KB
random_02 196 ms 5600 KB
random_03 207 ms 5600 KB
random_04 53 ms 5088 KB
random_05 333 ms 5856 KB
random_06 113 ms 5344 KB
random_07 44 ms 5088 KB
random_08 37 ms 5088 KB
sample_01 35 ms 5048 KB
sample_02 35 ms 5048 KB
sample_03 35 ms 5048 KB