結果

問題 No.278 連続する整数の和(2)
ユーザー takakintakakin
提出日時 2020-06-15 23:28:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 343 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 10,744 KB
実行使用メモリ 8,168 KB
最終ジャッジ日時 2023-09-16 10:40:35
合計ジャッジ時間 2,273 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,992 KB
testcase_01 AC 17 ms
8,080 KB
testcase_02 AC 102 ms
7,952 KB
testcase_03 AC 16 ms
8,048 KB
testcase_04 AC 15 ms
8,000 KB
testcase_05 AC 16 ms
7,960 KB
testcase_06 AC 16 ms
8,044 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 98 ms
7,936 KB
testcase_10 AC 120 ms
7,956 KB
testcase_11 AC 128 ms
8,000 KB
testcase_12 AC 15 ms
8,124 KB
testcase_13 AC 111 ms
8,012 KB
testcase_14 AC 68 ms
7,996 KB
testcase_15 AC 97 ms
7,912 KB
testcase_16 AC 80 ms
7,992 KB
testcase_17 AC 100 ms
8,012 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 d%4==0:
    ans+=d
print(ans)
0