結果

問題 No.864 四方演算
ユーザー kumatan400
提出日時 2022-07-10 03:03:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 52 ms / 1,000 ms
コード長 348 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 82,756 KB
実行使用メモリ 61,096 KB
最終ジャッジ日時 2025-01-02 00:42:28
合計ジャッジ時間 2,629 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
K = int(input())

D = []
i = 1
while i * i <= K:
    if K % i == 0:
        j = K // i
        D.append(i)
        if i != j:
            D.append(j)
    i += 1


ans = 0
for x in D:
    y = K // x

    t = max(0, x-1 - N)
    a = max(0, x-1 - 2*t)

    t = max(0, y-1 - N)
    b = max(0, y-1 - 2*t)

    ans += a * b



print(ans)
0