結果

問題 No.278 連続する整数の和(2)
ユーザー takakintakakin
提出日時 2020-06-15 23:35:05
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 132 ms / 2,000 ms
コード長 348 bytes
コンパイル時間 117 ms
コンパイル使用メモリ 10,768 KB
実行使用メモリ 8,124 KB
最終ジャッジ日時 2023-09-16 10:39:41
合計ジャッジ時間 2,471 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,976 KB
testcase_01 AC 16 ms
7,972 KB
testcase_02 AC 105 ms
8,076 KB
testcase_03 AC 17 ms
8,076 KB
testcase_04 AC 16 ms
7,976 KB
testcase_05 AC 18 ms
7,944 KB
testcase_06 AC 18 ms
7,976 KB
testcase_07 AC 20 ms
7,972 KB
testcase_08 AC 132 ms
8,036 KB
testcase_09 AC 102 ms
8,012 KB
testcase_10 AC 122 ms
7,856 KB
testcase_11 AC 128 ms
8,024 KB
testcase_12 AC 16 ms
7,972 KB
testcase_13 AC 111 ms
8,124 KB
testcase_14 AC 69 ms
7,952 KB
testcase_15 AC 98 ms
8,076 KB
testcase_16 AC 80 ms
7,980 KB
testcase_17 AC 100 ms
8,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys,heapq
input = sys.stdin.buffer.readline
n=int(input())
def make_divisors(n):
  divisors=[]
  for i in range(1,int(n**0.5)+1):
    if n%i==0:
      divisors.append(i)
      if i!=n//i:
        divisors.append(n//i)

  divisors.sort()
  return divisors
D=make_divisors(n)
ans=0
for d in D:
  if d%2==1 or (n//d)%2==0:
    ans+=d
print(ans)
0