結果

問題 No.864 四方演算
ユーザー kumatan400kumatan400
提出日時 2023-04-07 02:31:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 446 bytes
コンパイル時間 145 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 60,960 KB
最終ジャッジ日時 2024-04-10 16:10:41
合計ジャッジ時間 2,421 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
52,528 KB
testcase_01 AC 53 ms
57,788 KB
testcase_02 AC 44 ms
59,132 KB
testcase_03 AC 46 ms
57,732 KB
testcase_04 AC 50 ms
58,772 KB
testcase_05 AC 45 ms
57,456 KB
testcase_06 AC 49 ms
57,796 KB
testcase_07 AC 47 ms
58,320 KB
testcase_08 AC 46 ms
57,812 KB
testcase_09 AC 44 ms
58,440 KB
testcase_10 AC 44 ms
58,008 KB
testcase_11 AC 41 ms
57,916 KB
testcase_12 AC 47 ms
58,228 KB
testcase_13 AC 43 ms
58,588 KB
testcase_14 AC 38 ms
57,932 KB
testcase_15 AC 50 ms
57,308 KB
testcase_16 AC 47 ms
57,996 KB
testcase_17 AC 50 ms
59,540 KB
testcase_18 AC 54 ms
60,960 KB
testcase_19 AC 47 ms
58,552 KB
testcase_20 AC 51 ms
58,852 KB
testcase_21 AC 50 ms
59,176 KB
testcase_22 AC 49 ms
59,512 KB
testcase_23 AC 39 ms
59,460 KB
testcase_24 AC 45 ms
57,740 KB
testcase_25 AC 42 ms
57,720 KB
testcase_26 AC 47 ms
58,376 KB
testcase_27 AC 34 ms
52,676 KB
testcase_28 AC 34 ms
52,616 KB
testcase_29 AC 34 ms
52,752 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):
    s = min(N, x - 1)
    t = max(1, x - N)
    return max(0, s - t + 1)

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

print(ans)
0