結果

問題 No.864 四方演算
ユーザー e4q2pfnqe4q2pfnq
提出日時 2023-08-04 20:06:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 1,000 ms
コード長 443 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 61,184 KB
最終ジャッジ日時 2024-04-22 18:17:42
合計ジャッジ時間 3,455 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 45 ms
51,840 KB
testcase_01 AC 65 ms
57,472 KB
testcase_02 AC 60 ms
57,216 KB
testcase_03 AC 63 ms
57,472 KB
testcase_04 AC 62 ms
58,112 KB
testcase_05 AC 58 ms
57,216 KB
testcase_06 AC 63 ms
57,216 KB
testcase_07 AC 61 ms
57,344 KB
testcase_08 AC 60 ms
57,216 KB
testcase_09 AC 54 ms
56,960 KB
testcase_10 AC 56 ms
57,088 KB
testcase_11 AC 50 ms
57,088 KB
testcase_12 AC 57 ms
57,088 KB
testcase_13 AC 56 ms
57,344 KB
testcase_14 AC 50 ms
56,960 KB
testcase_15 AC 62 ms
57,216 KB
testcase_16 AC 58 ms
57,344 KB
testcase_17 AC 62 ms
57,984 KB
testcase_18 AC 69 ms
61,184 KB
testcase_19 AC 58 ms
57,472 KB
testcase_20 AC 65 ms
58,112 KB
testcase_21 AC 59 ms
57,984 KB
testcase_22 AC 60 ms
58,112 KB
testcase_23 AC 51 ms
57,984 KB
testcase_24 AC 56 ms
57,728 KB
testcase_25 AC 53 ms
57,600 KB
testcase_26 AC 59 ms
58,240 KB
testcase_27 AC 43 ms
51,968 KB
testcase_28 AC 46 ms
51,712 KB
testcase_29 AC 45 ms
51,968 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):
    t = min(N, x - 1)
    s = max(1, x - N)
    return max(0, t-s+1)

ans = 0
for i in make_divisors(K):
    j = K // i
    ans += f(i) * f(j)

print(ans)
0