結果

問題 No.864 四方演算
ユーザー titiatitia
提出日時 2019-08-16 22:14:17
言語 Python3
(3.11.2 + numpy 1.24.2 + scipy 1.10.1)
結果
AC  
実行時間 178 ms / 1,000 ms
コード長 293 bytes
コンパイル時間 218 ms
実行使用メモリ 7,964 KB
最終ジャッジ日時 2022-11-24 11:30:55
合計ジャッジ時間 4,884 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,780 KB
testcase_01 AC 178 ms
7,816 KB
testcase_02 AC 124 ms
7,704 KB
testcase_03 AC 139 ms
7,780 KB
testcase_04 AC 153 ms
7,828 KB
testcase_05 AC 113 ms
7,756 KB
testcase_06 AC 156 ms
7,832 KB
testcase_07 AC 141 ms
7,784 KB
testcase_08 AC 123 ms
7,720 KB
testcase_09 AC 79 ms
7,700 KB
testcase_10 AC 71 ms
7,852 KB
testcase_11 AC 44 ms
7,808 KB
testcase_12 AC 128 ms
7,832 KB
testcase_13 AC 93 ms
7,704 KB
testcase_14 AC 47 ms
7,704 KB
testcase_15 AC 175 ms
7,688 KB
testcase_16 AC 134 ms
7,716 KB
testcase_17 AC 152 ms
7,704 KB
testcase_18 AC 137 ms
7,964 KB
testcase_19 AC 109 ms
7,764 KB
testcase_20 AC 158 ms
7,836 KB
testcase_21 AC 131 ms
7,692 KB
testcase_22 AC 119 ms
7,848 KB
testcase_23 AC 30 ms
7,768 KB
testcase_24 AC 109 ms
7,820 KB
testcase_25 AC 65 ms
7,772 KB
testcase_26 AC 122 ms
7,832 KB
testcase_27 AC 16 ms
7,772 KB
testcase_28 AC 16 ms
7,776 KB
testcase_29 AC 16 ms
7,784 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