結果

問題 No.864 四方演算
ユーザー nadare
提出日時 2019-08-16 21:39:02
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 201 ms / 1,000 ms
コード長 364 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-09-25 10:44:08
合計ジャッジ時間 4,711 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
def inpl(): return list(map(int, input().split()))

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

ans = 0

def calc(z):
    if z <= N+1:
        return z-1
    elif z > 2*N:
        return 0
    else:
        return 2*N - z + 1
for x in range(1, int(sqrt(K))+1):
    if K%x:
        continue
    y = K//x
    ans += (1+(x!=y))*calc(x)*calc(y)
print(ans)
0