結果

問題 No.864 四方演算
ユーザー tcltktcltk
提出日時 2021-06-10 06:35:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 866 bytes
コンパイル時間 379 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 82,920 KB
最終ジャッジ日時 2023-08-19 16:35:41
合計ジャッジ時間 8,498 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 226 ms
80,924 KB
testcase_03 AC 227 ms
80,976 KB
testcase_04 AC 223 ms
80,892 KB
testcase_05 AC 223 ms
80,916 KB
testcase_06 AC 228 ms
80,796 KB
testcase_07 AC 226 ms
80,840 KB
testcase_08 AC 224 ms
80,992 KB
testcase_09 AC 220 ms
80,836 KB
testcase_10 AC 217 ms
81,108 KB
testcase_11 AC 210 ms
80,704 KB
testcase_12 AC 217 ms
81,012 KB
testcase_13 AC 216 ms
80,900 KB
testcase_14 AC 212 ms
80,944 KB
testcase_15 AC 224 ms
80,920 KB
testcase_16 AC 224 ms
80,760 KB
testcase_17 AC 226 ms
80,700 KB
testcase_18 AC 236 ms
82,920 KB
testcase_19 AC 228 ms
80,760 KB
testcase_20 AC 239 ms
81,196 KB
testcase_21 AC 231 ms
81,040 KB
testcase_22 AC 223 ms
80,920 KB
testcase_23 AC 213 ms
81,080 KB
testcase_24 AC 224 ms
81,072 KB
testcase_25 AC 223 ms
80,972 KB
testcase_26 AC 228 ms
80,960 KB
testcase_27 AC 216 ms
80,732 KB
testcase_28 AC 216 ms
80,652 KB
testcase_29 AC 221 ms
80,692 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
import bisect
import heapq


def input():
    return sys.stdin.readline()[:-1]


# sys.setrecursionlimit(1000000)

# _INPUT = """3
# 15
# """
# sys.stdin = io.StringIO(_INPUT)

def get_divisors(n):
    lower_divisors = []
    upper_divisors = []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors

def f(d):
    x = min(d, N)
    if max(1, d-x) <= min(x, d-1):
        return min(x, d-1) - max(1, d-x) + 1
    else:
        return 0

N = int(input())
K = int(input())
divs = get_divisors(K)
ans = 0
for d in divs:
    d1 = d
    d2 = K // d
    ans += f(d1) * f(d2)
print(2*ans)


0