結果
問題 | No.864 四方演算 |
ユーザー |
|
提出日時 | 2021-02-28 12:59:24 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 205 ms / 1,000 ms |
コード長 | 298 bytes |
コンパイル時間 | 94 ms |
コンパイル使用メモリ | 12,416 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-10-02 18:12:57 |
合計ジャッジ時間 | 4,771 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
from math import isqrtN = int(input())K = int(input())enum = lambda x: max(min(x - 1, 2 * N - x + 1), 0)ans = 0iq = isqrt(K)for ac in range(1, iq + 1):if K % ac:continuebd = K // acans += enum(ac) * enum(bd) * 2if iq ** 2 == K:ans -= enum(iq) ** 2print(ans)