結果

問題 No.864 四方演算
ユーザー ryuhei1230ryuhei1230
提出日時 2019-08-16 22:22:18
言語 PyPy3
(7.3.8)
結果
AC  
実行時間 105 ms / 1,000 ms
コード長 484 bytes
コンパイル時間 410 ms
使用メモリ 81,120 KB
最終ジャッジ日時 2022-11-24 11:31:04
合計ジャッジ時間 4,761 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 90 ms
75,888 KB
testcase_01 AC 105 ms
80,428 KB
testcase_02 AC 97 ms
80,412 KB
testcase_03 AC 98 ms
80,376 KB
testcase_04 AC 101 ms
80,528 KB
testcase_05 AC 97 ms
80,560 KB
testcase_06 AC 102 ms
80,628 KB
testcase_07 AC 97 ms
80,640 KB
testcase_08 AC 99 ms
80,572 KB
testcase_09 AC 95 ms
80,660 KB
testcase_10 AC 94 ms
80,348 KB
testcase_11 AC 92 ms
80,408 KB
testcase_12 AC 97 ms
80,616 KB
testcase_13 AC 93 ms
80,344 KB
testcase_14 AC 90 ms
80,424 KB
testcase_15 AC 101 ms
80,388 KB
testcase_16 AC 99 ms
80,348 KB
testcase_17 AC 98 ms
80,436 KB
testcase_18 AC 102 ms
81,120 KB
testcase_19 AC 96 ms
80,528 KB
testcase_20 AC 102 ms
80,372 KB
testcase_21 AC 97 ms
80,548 KB
testcase_22 AC 96 ms
80,392 KB
testcase_23 AC 88 ms
80,420 KB
testcase_24 AC 95 ms
80,556 KB
testcase_25 AC 93 ms
80,416 KB
testcase_26 AC 96 ms
80,444 KB
testcase_27 AC 85 ms
76,156 KB
testcase_28 AC 85 ms
76,052 KB
testcase_29 AC 85 ms
75,996 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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



def make_divisors(n):
    divisors = []
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            divisors.append((i, n//i))
            if i != n // i:
                divisors.append((n//i, i))

    return divisors


def dfs(x):
    if n >= x:
        return x - 1
    elif (x + 1) // 2 > n:
        return 0
    else:
        return n - (x - n) + 1



ret = 0
for a, b in make_divisors(k):
    ret += dfs(a) * dfs(b)


print(ret)
0