結果

問題 No.864 四方演算
ユーザー kumatan400kumatan400
提出日時 2023-03-18 13:03:58
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 450 bytes
コンパイル時間 158 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 62,188 KB
最終ジャッジ日時 2023-10-18 17:14:56
合計ジャッジ時間 2,914 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,552 KB
testcase_01 AC 52 ms
59,404 KB
testcase_02 AC 46 ms
57,356 KB
testcase_03 AC 47 ms
57,356 KB
testcase_04 AC 52 ms
59,404 KB
testcase_05 AC 46 ms
57,356 KB
testcase_06 AC 48 ms
57,356 KB
testcase_07 AC 51 ms
57,356 KB
testcase_08 AC 49 ms
57,356 KB
testcase_09 AC 43 ms
57,356 KB
testcase_10 AC 43 ms
57,356 KB
testcase_11 AC 42 ms
57,356 KB
testcase_12 AC 47 ms
57,356 KB
testcase_13 AC 45 ms
57,356 KB
testcase_14 AC 40 ms
57,356 KB
testcase_15 AC 54 ms
57,356 KB
testcase_16 AC 47 ms
57,356 KB
testcase_17 AC 52 ms
59,404 KB
testcase_18 AC 53 ms
62,188 KB
testcase_19 AC 49 ms
59,404 KB
testcase_20 AC 51 ms
59,404 KB
testcase_21 AC 51 ms
59,404 KB
testcase_22 AC 47 ms
59,404 KB
testcase_23 AC 39 ms
59,404 KB
testcase_24 AC 47 ms
59,404 KB
testcase_25 AC 44 ms
59,404 KB
testcase_26 AC 48 ms
59,404 KB
testcase_27 AC 34 ms
53,552 KB
testcase_28 AC 35 ms
53,552 KB
testcase_29 AC 36 ms
53,552 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):
    sita = max(1, x-N)
    ue = min(N, x-1)
    return max(0, ue - sita + 1)

ans = 0
for a in make_divisors(K):
    b = K // a
    ans += f(a) * f(b)

print(ans)
0