結果
問題 |
No.864 四方演算
|
ユーザー |
|
提出日時 | 2021-06-10 06:35:12 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 864 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 82,276 KB |
実行使用メモリ | 87,208 KB |
最終ジャッジ日時 | 2024-11-29 10:27:11 |
合計ジャッジ時間 | 5,386 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 3 WA * 24 |
ソースコード
#!/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(ans)