Submission #14763692


Source Code Expand

Copy
import sys
import numpy as np

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

def main(N):
    div = np.zeros(N+1, np.int64)
    for n in range(1, N+1):
      for m in range(n, N+1, n):
        div[m] += 1
    div *= np.arange(N + 1)
    return div.sum()

if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    i8 = numba.int64
    cc = CC('my_module')

    def cc_export(f, signature):
        cc.export(f.__name__, signature)(f)
        return numba.njit(f)

    main = cc_export(main, (i8, ))
    cc.compile()

from my_module import main

N = int(read())
print(main(N))

Submission Info

Submission Time
Task D - Sum of Divisors
User maspy
Language Python (3.8.2)
Score 400
Code Size 695 Byte
Status
Exec Time 1860 ms
Memory 183252 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt, sample_03.txt
All 400 / 400 hand_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, sample_01.txt, sample_02.txt, sample_03.txt, sq_01.txt, sq_02.txt, sq_03.txt, sq_04.txt, sq_05.txt, sq_06.txt
Case Name Status Exec Time Memory
hand_01.txt 129 ms 27032 KB
random_01.txt 1838 ms 183252 KB
random_02.txt 1428 ms 150264 KB
random_03.txt 1824 ms 183160 KB
random_04.txt 878 ms 104536 KB
random_05.txt 1843 ms 183028 KB
random_06.txt 647 ms 84476 KB
random_07.txt 1818 ms 183072 KB
random_08.txt 1108 ms 123280 KB
random_09.txt 1817 ms 183000 KB
random_10.txt 204 ms 43128 KB
sample_01.txt 130 ms 27312 KB
sample_02.txt 124 ms 27076 KB
sample_03.txt 1822 ms 182968 KB
sq_01.txt 1823 ms 182800 KB
sq_02.txt 1820 ms 182764 KB
sq_03.txt 1830 ms 182780 KB
sq_04.txt 1851 ms 182900 KB
sq_05.txt 1860 ms 182804 KB
sq_06.txt 1848 ms 182952 KB