結果

問題 No.864 四方演算
ユーザー AEnAEn
提出日時 2022-05-22 11:17:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 51 ms / 1,000 ms
コード長 429 bytes
コンパイル時間 248 ms
コンパイル使用メモリ 81,908 KB
実行使用メモリ 59,864 KB
最終ジャッジ日時 2023-10-20 16:55:29
合計ジャッジ時間 2,832 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
53,628 KB
testcase_01 AC 51 ms
57,748 KB
testcase_02 AC 47 ms
57,748 KB
testcase_03 AC 48 ms
57,748 KB
testcase_04 AC 51 ms
57,748 KB
testcase_05 AC 45 ms
57,748 KB
testcase_06 AC 47 ms
57,748 KB
testcase_07 AC 48 ms
57,748 KB
testcase_08 AC 44 ms
57,748 KB
testcase_09 AC 39 ms
57,748 KB
testcase_10 AC 39 ms
57,748 KB
testcase_11 AC 37 ms
57,748 KB
testcase_12 AC 45 ms
57,748 KB
testcase_13 AC 41 ms
57,748 KB
testcase_14 AC 38 ms
57,748 KB
testcase_15 AC 51 ms
57,748 KB
testcase_16 AC 45 ms
57,748 KB
testcase_17 AC 47 ms
59,796 KB
testcase_18 AC 46 ms
59,864 KB
testcase_19 AC 45 ms
59,796 KB
testcase_20 AC 51 ms
59,796 KB
testcase_21 AC 48 ms
59,796 KB
testcase_22 AC 47 ms
59,800 KB
testcase_23 AC 37 ms
57,752 KB
testcase_24 AC 47 ms
57,748 KB
testcase_25 AC 42 ms
59,796 KB
testcase_26 AC 46 ms
59,796 KB
testcase_27 AC 34 ms
53,628 KB
testcase_28 AC 34 ms
53,628 KB
testcase_29 AC 37 ms
53,628 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if K < 4:
    print(0)
    exit()
res = 0
for i in range(2,K+1):
    if i*i>K:
        break
    if K%i == 0 and i<=2*N and K//i<=2*N:
        s = 1
        if i != K//i:
            s *= 2
        if i > N:
            s *= abs((i-N)-N)+1
        else:
            s *= i-1
        if K//i>N:
            s *= abs((K//i-N)-N)+1
        else:
            s *= K//i-1
        res += s
print(res)
0