結果
問題 |
No.864 四方演算
|
ユーザー |
|
提出日時 | 2021-12-15 19:19:07 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 57 ms / 1,000 ms |
コード長 | 526 bytes |
コンパイル時間 | 505 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 60,928 KB |
最終ジャッジ日時 | 2024-07-23 20:00:48 |
合計ジャッジ時間 | 2,813 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
N = int(input()) K = int(input()) def f(x): #足してxの両方1以上N以下の2数の組み合わせの数 d = max(0, x-1-N) res = max(0, x-1 - d*2) return res # 約数のリストを得る 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) return divisors D = make_divisors(K) ans = 0 for d in D: a = K // d ans += f(a) * f(d) print(ans)