結果

問題 No.2480 Sequence Sum
ユーザー ゼットゼット
提出日時 2023-09-28 07:45:32
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 500 ms
コード長 398 bytes
コンパイル時間 312 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 85,548 KB
最終ジャッジ日時 2023-10-04 12:35:38
合計ジャッジ時間 2,515 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,560 KB
testcase_01 AC 75 ms
71,508 KB
testcase_02 AC 86 ms
79,388 KB
testcase_03 AC 84 ms
76,576 KB
testcase_04 AC 89 ms
79,332 KB
testcase_05 AC 96 ms
85,548 KB
testcase_06 AC 91 ms
81,128 KB
testcase_07 AC 89 ms
80,192 KB
testcase_08 AC 81 ms
76,708 KB
testcase_09 AC 94 ms
84,296 KB
testcase_10 AC 92 ms
81,616 KB
testcase_11 AC 90 ms
79,868 KB
testcase_12 AC 97 ms
85,240 KB
testcase_13 AC 95 ms
85,224 KB
testcase_14 AC 95 ms
84,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

A=set()
N=int(input())
from math import sqrt
k=int(sqrt(N))
for x in range(1,k+1):
  t=N%x
  if t==0:
    u=x
  else:
    u=t
  f=u*(x+1)
  if f<N:
    A.add(x)
for y in range(2,k+1):
  x=N//y
  t=N%x
  if t==0:
    u=x
  else:
    u=t
  f=u*(x+1)
  if f<N:
    A.add(x)
result=0
for x in A:
  t=N%x
  u=x-t
  if t==0:
    u=x
  else:
    u=t
  p=(N-u*(x+1))//x
  result+=(p+x)//(x+1)
print(result)
0