結果

問題 No.864 四方演算
ユーザー irumo8202irumo8202
提出日時 2022-01-28 17:18:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 1,000 ms
コード長 373 bytes
コンパイル時間 271 ms
コンパイル使用メモリ 86,684 KB
実行使用メモリ 76,008 KB
最終ジャッジ日時 2023-08-28 14:38:44
合計ジャッジ時間 4,743 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,380 KB
testcase_01 AC 90 ms
75,348 KB
testcase_02 AC 85 ms
75,680 KB
testcase_03 AC 85 ms
75,504 KB
testcase_04 AC 88 ms
75,052 KB
testcase_05 AC 83 ms
75,448 KB
testcase_06 AC 87 ms
75,256 KB
testcase_07 AC 85 ms
75,052 KB
testcase_08 AC 87 ms
75,068 KB
testcase_09 AC 79 ms
75,068 KB
testcase_10 AC 80 ms
75,164 KB
testcase_11 AC 75 ms
75,444 KB
testcase_12 AC 84 ms
75,444 KB
testcase_13 AC 81 ms
75,532 KB
testcase_14 AC 77 ms
75,256 KB
testcase_15 AC 90 ms
75,220 KB
testcase_16 AC 85 ms
75,112 KB
testcase_17 AC 89 ms
75,184 KB
testcase_18 AC 90 ms
76,008 KB
testcase_19 AC 81 ms
75,344 KB
testcase_20 AC 87 ms
75,160 KB
testcase_21 AC 87 ms
75,300 KB
testcase_22 AC 84 ms
75,372 KB
testcase_23 AC 73 ms
75,532 KB
testcase_24 AC 83 ms
75,528 KB
testcase_25 AC 79 ms
75,380 KB
testcase_26 AC 88 ms
75,440 KB
testcase_27 AC 71 ms
71,376 KB
testcase_28 AC 70 ms
71,084 KB
testcase_29 AC 71 ms
71,108 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def make_divs(n):
    divs = set()
    i = 1
    while i * i <= n:
        if n % i == 0:
            divs.add(i)
            divs.add(n // i)
        i += 1
    return divs


def cnt(x):
    l = max(1, x - N)
    r = min(x - 1, N)
    return max(0, r - l + 1)


ans = 0
for d in make_divs(K):
    ans += cnt(d) * cnt(K // d)
print(ans)
0