結果

問題 No.864 四方演算
ユーザー titiatitia
提出日時 2019-08-16 22:14:17
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 183 ms / 1,000 ms
コード長 293 bytes
コンパイル時間 73 ms
コンパイル使用メモリ 11,876 KB
実行使用メモリ 10,280 KB
最終ジャッジ日時 2023-10-26 02:46:59
合計ジャッジ時間 4,200 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,192 KB
testcase_01 AC 183 ms
10,204 KB
testcase_02 AC 127 ms
10,192 KB
testcase_03 AC 149 ms
10,192 KB
testcase_04 AC 159 ms
10,204 KB
testcase_05 AC 116 ms
10,192 KB
testcase_06 AC 151 ms
10,192 KB
testcase_07 AC 143 ms
10,192 KB
testcase_08 AC 127 ms
10,192 KB
testcase_09 AC 91 ms
10,192 KB
testcase_10 AC 79 ms
10,192 KB
testcase_11 AC 53 ms
10,192 KB
testcase_12 AC 130 ms
10,192 KB
testcase_13 AC 100 ms
10,192 KB
testcase_14 AC 56 ms
10,192 KB
testcase_15 AC 176 ms
10,192 KB
testcase_16 AC 132 ms
10,192 KB
testcase_17 AC 152 ms
10,236 KB
testcase_18 AC 140 ms
10,280 KB
testcase_19 AC 114 ms
10,204 KB
testcase_20 AC 159 ms
10,240 KB
testcase_21 AC 138 ms
10,240 KB
testcase_22 AC 124 ms
10,236 KB
testcase_23 AC 40 ms
10,204 KB
testcase_24 AC 113 ms
10,204 KB
testcase_25 AC 72 ms
10,236 KB
testcase_26 AC 125 ms
10,236 KB
testcase_27 AC 27 ms
10,192 KB
testcase_28 AC 27 ms
10,192 KB
testcase_29 AC 27 ms
10,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

x=K
import math
xr=math.ceil(math.sqrt(x))

LIST=[]
for i in range(1,xr+1):
    if x%i==0:
        LIST.append(i)
        LIST.append(x//i)

LIST=sorted(set(LIST))

ANS=0

for l in LIST:
    ANS+=max(0,(l-1-max(l-1-N,0)*2)*(K//l-1-max(K//l-1-N,0)*2))

print(ANS)
0