結果

問題 No.864 四方演算
ユーザー kumatankumatan
提出日時 2021-05-29 13:09:07
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 92 ms / 1,000 ms
コード長 388 bytes
コンパイル時間 432 ms
コンパイル使用メモリ 86,896 KB
実行使用メモリ 76,348 KB
最終ジャッジ日時 2023-08-07 17:01:54
合計ジャッジ時間 4,235 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,516 KB
testcase_01 AC 92 ms
75,904 KB
testcase_02 AC 88 ms
76,048 KB
testcase_03 AC 88 ms
75,752 KB
testcase_04 AC 89 ms
75,944 KB
testcase_05 AC 85 ms
76,344 KB
testcase_06 AC 90 ms
75,836 KB
testcase_07 AC 87 ms
75,816 KB
testcase_08 AC 85 ms
75,928 KB
testcase_09 AC 82 ms
75,912 KB
testcase_10 AC 81 ms
75,848 KB
testcase_11 AC 79 ms
76,072 KB
testcase_12 AC 86 ms
75,928 KB
testcase_13 AC 83 ms
75,828 KB
testcase_14 AC 80 ms
75,856 KB
testcase_15 AC 90 ms
75,860 KB
testcase_16 AC 87 ms
76,348 KB
testcase_17 AC 90 ms
75,920 KB
testcase_18 AC 91 ms
75,928 KB
testcase_19 AC 86 ms
75,932 KB
testcase_20 AC 88 ms
75,976 KB
testcase_21 AC 86 ms
76,100 KB
testcase_22 AC 85 ms
75,876 KB
testcase_23 AC 77 ms
76,004 KB
testcase_24 AC 86 ms
75,932 KB
testcase_25 AC 81 ms
75,952 KB
testcase_26 AC 86 ms
76,064 KB
testcase_27 AC 75 ms
71,788 KB
testcase_28 AC 75 ms
71,656 KB
testcase_29 AC 74 ms
71,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
for i in range(1, int(K**0.5) + 1):
    if K%i == 0:
        j = K//i

        if N >= i-1:
            p = i-1
        else:
            p = max(0, -i+1+2*N)

        if N >= j-1:
            q = j-1
        else:
            q = max(0, -j+1+2*N)


        if i != j:
            ans += p*q * 2
        else:
            ans += p*q


print(ans)
0