Submission #16881691


Source Code Expand

Copy
"""O(N^0.5) solution"""

N = int(input())
N -= 1

ans = 0
n = int(N**.5)
for x in range(1, n+1):
  # (x,x)
  ans += 1
  # (x,y)
  ans += N//x - x
  # (y,x)
  ans += N//x - x

print(ans)

Submission Info

Submission Time
Task C - A x B + C
User maspy
Language Python (3.8.2)
Score 300
Code Size 200 Byte
Status
Exec Time 31 ms
Memory 9360 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 29 ms 9296 KB
00-sample-02.txt 28 ms 9096 KB
00-sample-03.txt 21 ms 9288 KB
01-small-01.txt 25 ms 9276 KB
01-small-02.txt 24 ms 9272 KB
01-small-03.txt 28 ms 9108 KB
01-small-04.txt 27 ms 9096 KB
01-small-05.txt 27 ms 9232 KB
01-small-06.txt 25 ms 9292 KB
01-small-07.txt 30 ms 9104 KB
01-small-08.txt 20 ms 9272 KB
01-small-09.txt 30 ms 9232 KB
01-small-10.txt 22 ms 9228 KB
02-min-01.txt 27 ms 8968 KB
03-random-01.txt 21 ms 9292 KB
03-random-02.txt 26 ms 9288 KB
03-random-03.txt 26 ms 9096 KB
03-random-04.txt 29 ms 9092 KB
03-random-05.txt 26 ms 9172 KB
05-highly-composite-number-01.txt 20 ms 9352 KB
05-highly-composite-number-02.txt 31 ms 9268 KB
05-highly-composite-number-03.txt 24 ms 9164 KB
05-highly-composite-number-04.txt 28 ms 9292 KB
05-highly-composite-number-05.txt 26 ms 9096 KB
06-highly-composite-number-01.txt 29 ms 9260 KB
06-highly-composite-number-02.txt 31 ms 9092 KB
06-highly-composite-number-03.txt 22 ms 9100 KB
06-highly-composite-number-04.txt 19 ms 9100 KB
06-highly-composite-number-05.txt 28 ms 9208 KB
07-highly-composite-number-01.txt 30 ms 9360 KB
07-highly-composite-number-02.txt 20 ms 9232 KB
07-highly-composite-number-03.txt 25 ms 9256 KB
07-highly-composite-number-04.txt 31 ms 9272 KB
07-highly-composite-number-05.txt 30 ms 9352 KB
08-max-01.txt 25 ms 9092 KB
08-max-02.txt 26 ms 9292 KB
08-max-03.txt 27 ms 9228 KB