結果
| 問題 | 
                            No.864 四方演算
                             | 
                    
| コンテスト | |
| ユーザー | 
                             瀬良奈々葉
                         | 
                    
| 提出日時 | 2024-10-16 15:21:48 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 58 ms / 1,000 ms | 
| コード長 | 445 bytes | 
| コンパイル時間 | 260 ms | 
| コンパイル使用メモリ | 82,300 KB | 
| 実行使用メモリ | 61,504 KB | 
| 最終ジャッジ日時 | 2024-10-16 15:21:52 | 
| 合計ジャッジ時間 | 3,284 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 27 | 
ソースコード
def make_divisors(n):
    divisors = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            divisors.append(i)
            j = n // i
            if i != j:
                divisors.append(j)
        i += 1
    return divisors
N = int(input())
K = int(input())
def f(x):
    a = min(x-1, N)
    b = max(1, x-N)
    return max(0, a - b + 1)
ans = 0
for x in make_divisors(K):
    y = K // x
    ans += f(x) * f(y)
print(ans)
            
            
            
        
            
瀬良奈々葉