結果
問題 | No.864 四方演算 |
ユーザー |
|
提出日時 | 2022-09-10 14:55:02 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 56 ms / 1,000 ms |
コード長 | 438 bytes |
コンパイル時間 | 360 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 60,160 KB |
最終ジャッジ日時 | 2024-11-26 18:37:01 |
合計ジャッジ時間 | 2,870 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
N = int(input()) K = int(input()) def make_divisors(n): divisors = [] i = 1 while i * i <= n: if n % i == 0: divisors.append(i) j = n // i if i != j: divisors.append(j) i += 1 return divisors ans = 0 for d in make_divisors(K): t = K // d a = max(0, d-1 - max(0, d-1 - N)*2) b = max(0, t-1 - max(0, t-1 - N)*2) ans += a * b print(ans)