結果

問題 No.864 四方演算
ユーザー aaaaaaaaaa2230
提出日時 2022-05-21 11:35:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 59 ms / 1,000 ms
コード長 400 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,420 KB
実行使用メモリ 58,880 KB
最終ジャッジ日時 2024-09-20 11:24:25
合計ジャッジ時間 2,493 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 27
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
k = int(input())

def count(x):

    if x > 2*n:
        return 0

    if x <= n+1:
        return x-1
    
    dif = x-(n+1)
    return n - dif

ans = 0
for i in range(2,int(k**0.5)+1):

    if k%i:
        continue

    x = i
    y = k//i
    if y == 1:
        continue
    
    if x == y and count(x) == 1:
        ans += 1
    else:
        ans += 2*count(x)*count(y)
print(ans)
0