結果

問題 No.864 四方演算
ユーザー realDivineJKrealDivineJK
提出日時 2020-05-26 03:52:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 342 ms / 1,000 ms
コード長 225 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-21 04:07:47
合計ジャッジ時間 6,617 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
10,752 KB
testcase_01 AC 342 ms
10,752 KB
testcase_02 AC 218 ms
10,624 KB
testcase_03 AC 239 ms
10,752 KB
testcase_04 AC 280 ms
10,624 KB
testcase_05 AC 197 ms
10,752 KB
testcase_06 AC 266 ms
10,624 KB
testcase_07 AC 241 ms
10,752 KB
testcase_08 AC 236 ms
10,624 KB
testcase_09 AC 150 ms
10,624 KB
testcase_10 AC 126 ms
10,752 KB
testcase_11 AC 74 ms
10,624 KB
testcase_12 AC 213 ms
10,624 KB
testcase_13 AC 167 ms
10,752 KB
testcase_14 AC 83 ms
10,624 KB
testcase_15 AC 304 ms
10,752 KB
testcase_16 AC 241 ms
10,752 KB
testcase_17 AC 268 ms
10,752 KB
testcase_18 AC 250 ms
10,752 KB
testcase_19 AC 186 ms
10,624 KB
testcase_20 AC 279 ms
10,752 KB
testcase_21 AC 222 ms
10,624 KB
testcase_22 AC 212 ms
10,752 KB
testcase_23 AC 49 ms
10,752 KB
testcase_24 AC 195 ms
10,752 KB
testcase_25 AC 112 ms
10,752 KB
testcase_26 AC 220 ms
10,624 KB
testcase_27 AC 27 ms
10,752 KB
testcase_28 AC 25 ms
10,752 KB
testcase_29 AC 26 ms
10,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
K = int(input())
def rem(x):
    return x-1-2*(x-1-N)*(x-2>=N)+(x-1-2*N)*(x-2>=2*N)
X = 0
p = 1
while p * p < K:
    if K % p == 0:
        X += rem(p) * rem(K//p)
    p += 1
print(2*X+(p*p==K)*rem(p)*rem(p))
0