結果
問題 |
No.2480 Sequence Sum
|
ユーザー |
|
提出日時 | 2023-09-22 23:21:10 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 683 bytes |
コンパイル時間 | 337 ms |
コンパイル使用メモリ | 82,560 KB |
実行使用メモリ | 58,624 KB |
最終ジャッジ日時 | 2024-07-08 14:00:15 |
合計ジャッジ時間 | 1,713 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | WA * 13 |
ソースコード
import sys input = sys.stdin.readline def make_divisors(n): lower_divisors , upper_divisors = [], [] i = 1 while i*i <= n: if n % i == 0: lower_divisors.append(i) if i != n // i: upper_divisors.append(n//i) i += 1 return lower_divisors + upper_divisors[::-1] N = int(input()) Y = make_divisors(N) ans = 0 for y in Y: tmp = N//y if y==1: cnt = (tmp+1)//2-1 #print(cnt) if cnt>0: ans += cnt else: break else: cnt = (tmp+y)//(y+1)-1 #print(cnt) if cnt>0: ans += cnt else: break print(ans)