結果

問題 No.864 四方演算
ユーザー kumatan400kumatan400
提出日時 2021-12-15 19:19:07
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 526 bytes
コンパイル時間 1,224 ms
コンパイル使用メモリ 86,808 KB
実行使用メモリ 76,544 KB
最終ジャッジ日時 2023-10-01 02:32:39
合計ジャッジ時間 5,039 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,700 KB
testcase_01 AC 90 ms
75,596 KB
testcase_02 AC 83 ms
75,516 KB
testcase_03 AC 82 ms
75,548 KB
testcase_04 AC 84 ms
75,528 KB
testcase_05 AC 80 ms
75,636 KB
testcase_06 AC 87 ms
75,456 KB
testcase_07 AC 83 ms
75,764 KB
testcase_08 AC 82 ms
75,660 KB
testcase_09 AC 78 ms
75,912 KB
testcase_10 AC 80 ms
75,660 KB
testcase_11 AC 75 ms
75,456 KB
testcase_12 AC 83 ms
75,608 KB
testcase_13 AC 79 ms
75,620 KB
testcase_14 AC 75 ms
75,356 KB
testcase_15 AC 86 ms
75,916 KB
testcase_16 AC 82 ms
75,912 KB
testcase_17 AC 86 ms
75,564 KB
testcase_18 AC 92 ms
76,544 KB
testcase_19 AC 81 ms
75,752 KB
testcase_20 AC 86 ms
75,580 KB
testcase_21 AC 83 ms
75,524 KB
testcase_22 AC 82 ms
75,724 KB
testcase_23 AC 74 ms
75,760 KB
testcase_24 AC 81 ms
75,552 KB
testcase_25 AC 77 ms
75,604 KB
testcase_26 AC 82 ms
75,588 KB
testcase_27 AC 70 ms
71,640 KB
testcase_28 AC 71 ms
71,736 KB
testcase_29 AC 68 ms
71,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def f(x):
    #足してxの両方1以上N以下の2数の組み合わせの数
    d = max(0, x-1-N)
    res = max(0, x-1 - d*2)
    return res


# 約数のリストを得る
def make_divisors(n):
    divisors = []
    for i in range(1, int(n ** 0.5) + 1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n // i)
    return divisors

D = make_divisors(K)
ans = 0
for d in D:
    a = K // d
    ans += f(a) * f(d)
print(ans)
0