結果

問題 No.864 四方演算
ユーザー kutaragi36kutaragi36
提出日時 2023-06-23 13:02:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 462 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 76,172 KB
最終ジャッジ日時 2023-09-13 07:55:55
合計ジャッジ時間 4,614 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,280 KB
testcase_01 AC 88 ms
75,284 KB
testcase_02 AC 82 ms
75,364 KB
testcase_03 AC 84 ms
75,268 KB
testcase_04 AC 87 ms
75,348 KB
testcase_05 AC 82 ms
75,324 KB
testcase_06 AC 87 ms
75,464 KB
testcase_07 AC 84 ms
75,392 KB
testcase_08 AC 85 ms
75,412 KB
testcase_09 AC 77 ms
75,232 KB
testcase_10 AC 77 ms
75,268 KB
testcase_11 AC 75 ms
75,280 KB
testcase_12 AC 82 ms
75,448 KB
testcase_13 AC 78 ms
75,248 KB
testcase_14 AC 74 ms
75,256 KB
testcase_15 AC 88 ms
75,252 KB
testcase_16 AC 83 ms
75,716 KB
testcase_17 AC 84 ms
75,452 KB
testcase_18 AC 88 ms
76,172 KB
testcase_19 AC 81 ms
75,252 KB
testcase_20 AC 86 ms
75,452 KB
testcase_21 AC 83 ms
75,380 KB
testcase_22 AC 83 ms
75,276 KB
testcase_23 AC 73 ms
75,112 KB
testcase_24 AC 81 ms
75,260 KB
testcase_25 AC 77 ms
75,448 KB
testcase_26 AC 83 ms
75,252 KB
testcase_27 AC 68 ms
71,288 KB
testcase_28 AC 68 ms
71,268 KB
testcase_29 AC 68 ms
71,276 KB
権限があれば一括ダウンロードができます

ソースコード

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