結果

問題 No.864 四方演算
ユーザー kutaragi36
提出日時 2023-06-23 13:02:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 58 ms / 1,000 ms
コード長 462 bytes
コンパイル時間 152 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 60,672 KB
最終ジャッジ日時 2024-06-30 17:56:45
合計ジャッジ時間 2,790 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

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


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

def f(x):
    a = max(1, x - N)
    b = min(N, x - 1)
    res = max(0, b - a + 1)
    return res


ans = 0
for x in make_divisors(K):
    y = K // x
    ans += f(x) * f(y)

print(ans)
0