Submission #54122129


Source Code Expand

N = int(input())
A = sorted(list(map(int, input().split())))

mem = {}
for i in range(N):
    for j in range(i + 1, N):
        a = A[i]
        b = A[j]
        if mem.get((a, b)) is not None:
            continue
        f = b // a
        mem[(a, b)] = f
ans = 0
for i in range(N):
    for j in range(i + 1, N):
        a = A[i]
        b = A[j]
        ans += mem[(a, b)]

print(ans)

Submission Info

Submission Time
Task E - Max/Min
User mu16
Language Python (PyPy 3.10-v7.3.12)
Score 0
Code Size 408 Byte
Status TLE
Exec Time 2242 ms
Memory 707772 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 475
Status
AC × 3
AC × 4
TLE × 21
Set Name Test Cases
Sample sample_01.txt, sample_02.txt, sample_03.txt
All min_01.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, sample_01.txt, sample_02.txt, sample_03.txt
Case Name Status Exec Time Memory
min_01.txt AC 55 ms 76444 KiB
random_01.txt TLE 2213 ms 130132 KiB
random_02.txt TLE 2212 ms 102340 KiB
random_03.txt TLE 2212 ms 129908 KiB
random_04.txt TLE 2212 ms 129724 KiB
random_05.txt TLE 2213 ms 129756 KiB
random_06.txt TLE 2212 ms 131624 KiB
random_07.txt TLE 2214 ms 152080 KiB
random_08.txt TLE 2223 ms 338008 KiB
random_09.txt TLE 2214 ms 152496 KiB
random_10.txt TLE 2215 ms 160524 KiB
random_11.txt TLE 2214 ms 151828 KiB
random_12.txt TLE 2214 ms 156892 KiB
random_13.txt TLE 2239 ms 642436 KiB
random_14.txt TLE 2241 ms 654092 KiB
random_15.txt TLE 2239 ms 641996 KiB
random_16.txt TLE 2241 ms 707084 KiB
random_17.txt TLE 2212 ms 111428 KiB
random_18.txt TLE 2212 ms 114264 KiB
random_19.txt TLE 2212 ms 115392 KiB
random_20.txt TLE 2239 ms 659912 KiB
random_21.txt TLE 2242 ms 707772 KiB
sample_01.txt AC 55 ms 76368 KiB
sample_02.txt AC 56 ms 76508 KiB
sample_03.txt AC 56 ms 76284 KiB