結果

問題 No.864 四方演算
ユーザー convexineqconvexineq
提出日時 2021-04-04 20:21:04
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 515 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 87,196 KB
実行使用メモリ 79,188 KB
最終ジャッジ日時 2023-08-27 21:55:25
合計ジャッジ時間 4,693 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,140 KB
testcase_01 RE -
testcase_02 AC 85 ms
75,152 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 73 ms
71,384 KB
testcase_28 AC 76 ms
71,096 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor_list(N): #約数のリスト
    if N == 1: return [1]
    res = []
    for i in range(1,N):
        if i*i >= N: break
        if N%i == 0:
            res.append(i)
            res.append(n//i)
    if i*i == N: res.append(i)
    return sorted(res)

n = int(input())
k = int(input())

def f(d,n):
    if d < 0: return 0
    r = (d+1)
    if d >= n:
        r -= 2*(d-n+1)
    if d >= 2*n:
        r += (d-2*n+1)
    return r

ans = 0
for d in divisor_list(k):
    ans += f(d-2,n)*f(k//d-2,n)
print(ans)
0