Submission #16879653


Source Code Expand

Copy
N=int(input())

# 約数の個数のテーブルを O(N loglog N) で作る
div = [1] * (N+1)
div[0] = 0

for p in range(2, N+1):
  if div[p] != 1:
    continue
  # p は素数
  pp = p  # power of p
  e = 1
  while pp <= N:
    for n in range(pp, N+1, pp):
      div[n] += div[n] // e
    e += 1
    pp *= p  

ans = sum(div[:N])
print(ans)

Submission Info

Submission Time
Task C - A x B + C
User maspy
Language Python (3.8.2)
Score 300
Code Size 360 Byte
Status
Exec Time 874 ms
Memory 24732 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
× 3
× 37
Set Name Test Cases
Sample 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt
All 00-sample-01.txt, 00-sample-02.txt, 00-sample-03.txt, 01-small-01.txt, 01-small-02.txt, 01-small-03.txt, 01-small-04.txt, 01-small-05.txt, 01-small-06.txt, 01-small-07.txt, 01-small-08.txt, 01-small-09.txt, 01-small-10.txt, 02-min-01.txt, 03-random-01.txt, 03-random-02.txt, 03-random-03.txt, 03-random-04.txt, 03-random-05.txt, 05-highly-composite-number-01.txt, 05-highly-composite-number-02.txt, 05-highly-composite-number-03.txt, 05-highly-composite-number-04.txt, 05-highly-composite-number-05.txt, 06-highly-composite-number-01.txt, 06-highly-composite-number-02.txt, 06-highly-composite-number-03.txt, 06-highly-composite-number-04.txt, 06-highly-composite-number-05.txt, 07-highly-composite-number-01.txt, 07-highly-composite-number-02.txt, 07-highly-composite-number-03.txt, 07-highly-composite-number-04.txt, 07-highly-composite-number-05.txt, 08-max-01.txt, 08-max-02.txt, 08-max-03.txt
Case Name Status Exec Time Memory
00-sample-01.txt 26 ms 8900 KB
00-sample-02.txt 28 ms 9016 KB
00-sample-03.txt 874 ms 24560 KB
01-small-01.txt 29 ms 8908 KB
01-small-02.txt 23 ms 9016 KB
01-small-03.txt 26 ms 9104 KB
01-small-04.txt 31 ms 9204 KB
01-small-05.txt 33 ms 8908 KB
01-small-06.txt 27 ms 9132 KB
01-small-07.txt 30 ms 9200 KB
01-small-08.txt 21 ms 9064 KB
01-small-09.txt 23 ms 9068 KB
01-small-10.txt 34 ms 9012 KB
02-min-01.txt 27 ms 9064 KB
03-random-01.txt 103 ms 10584 KB
03-random-02.txt 714 ms 22520 KB
03-random-03.txt 267 ms 13964 KB
03-random-04.txt 120 ms 10520 KB
03-random-05.txt 48 ms 9092 KB
05-highly-composite-number-01.txt 606 ms 19908 KB
05-highly-composite-number-02.txt 559 ms 19284 KB
05-highly-composite-number-03.txt 470 ms 17276 KB
05-highly-composite-number-04.txt 105 ms 10412 KB
05-highly-composite-number-05.txt 46 ms 9096 KB
06-highly-composite-number-01.txt 599 ms 20220 KB
06-highly-composite-number-02.txt 586 ms 19428 KB
06-highly-composite-number-03.txt 466 ms 17396 KB
06-highly-composite-number-04.txt 108 ms 10516 KB
06-highly-composite-number-05.txt 46 ms 9092 KB
07-highly-composite-number-01.txt 599 ms 20072 KB
07-highly-composite-number-02.txt 556 ms 19232 KB
07-highly-composite-number-03.txt 440 ms 17264 KB
07-highly-composite-number-04.txt 105 ms 10568 KB
07-highly-composite-number-05.txt 45 ms 9088 KB
08-max-01.txt 835 ms 24396 KB
08-max-02.txt 846 ms 24732 KB
08-max-03.txt 866 ms 24516 KB