結果

問題 No.864 四方演算
ユーザー kumatan400kumatan400
提出日時 2021-09-05 06:41:33
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 88 ms / 1,000 ms
コード長 280 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 76,336 KB
最終ジャッジ日時 2023-08-23 14:01:44
合計ジャッジ時間 3,953 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,732 KB
testcase_01 AC 87 ms
76,236 KB
testcase_02 AC 83 ms
76,160 KB
testcase_03 AC 85 ms
76,108 KB
testcase_04 AC 85 ms
75,972 KB
testcase_05 AC 83 ms
76,112 KB
testcase_06 AC 86 ms
76,232 KB
testcase_07 AC 84 ms
76,020 KB
testcase_08 AC 83 ms
76,144 KB
testcase_09 AC 79 ms
76,108 KB
testcase_10 AC 80 ms
76,092 KB
testcase_11 AC 77 ms
76,152 KB
testcase_12 AC 83 ms
76,304 KB
testcase_13 AC 80 ms
76,200 KB
testcase_14 AC 77 ms
76,168 KB
testcase_15 AC 88 ms
76,212 KB
testcase_16 AC 84 ms
76,044 KB
testcase_17 AC 86 ms
76,148 KB
testcase_18 AC 86 ms
76,336 KB
testcase_19 AC 82 ms
76,312 KB
testcase_20 AC 88 ms
75,984 KB
testcase_21 AC 86 ms
76,024 KB
testcase_22 AC 86 ms
76,252 KB
testcase_23 AC 76 ms
76,168 KB
testcase_24 AC 83 ms
76,168 KB
testcase_25 AC 79 ms
76,180 KB
testcase_26 AC 84 ms
76,072 KB
testcase_27 AC 72 ms
71,812 KB
testcase_28 AC 73 ms
71,624 KB
testcase_29 AC 72 ms
71,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 0
for a in range(1, int(K**0.5)+1):
    if K % a != 0:
        continue
    b = K // a

    na = min(a-1, max(0, 2*N-a+1))
    nb = min(b-1, max(0, 2*N-b+1))

    if a == b:
        ans += na*nb
    else:
        ans += na*nb*2

print(ans)
0