結果

問題 No.2480 Sequence Sum
コンテスト
ユーザー なえしら
提出日時 2024-04-14 19:40:29
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 29 ms / 500 ms
コード長 290 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 170 ms
コンパイル使用メモリ 85,120 KB
実行使用メモリ 58,496 KB
最終ジャッジ日時 2026-04-19 21:51:23
合計ジャッジ時間 1,746 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 13
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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