結果

問題 No.2480 Sequence Sum
ユーザー naesiranaesira
提出日時 2024-04-14 19:40:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 500 ms
コード長 290 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 82,444 KB
実行使用メモリ 58,992 KB
最終ジャッジ日時 2024-04-14 19:40:31
合計ジャッジ時間 1,596 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,076 KB
testcase_01 AC 40 ms
52,464 KB
testcase_02 AC 41 ms
58,388 KB
testcase_03 AC 39 ms
57,040 KB
testcase_04 AC 40 ms
58,608 KB
testcase_05 AC 40 ms
58,728 KB
testcase_06 AC 40 ms
57,688 KB
testcase_07 AC 40 ms
58,268 KB
testcase_08 AC 40 ms
58,412 KB
testcase_09 AC 40 ms
58,768 KB
testcase_10 AC 39 ms
57,816 KB
testcase_11 AC 39 ms
58,440 KB
testcase_12 AC 44 ms
58,992 KB
testcase_13 AC 40 ms
57,568 KB
testcase_14 AC 42 ms
58,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import isqrt

def divisors(n):
  r = isqrt(n - 1) + 1
  small, large = [], []
  for i in range(1, r):
    if n % i == 0:
      small.append(i)
      large.append(n//i)
  if r**2 == n: small.append(r)
  return small + large[::-1]

N = int(input())
D = divisors(N)
print(N - len(D))
0