結果
| 問題 | No.864 四方演算 |
| コンテスト | |
| ユーザー |
双六
|
| 提出日時 | 2020-07-24 20:42:05 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
AC
|
| 実行時間 | 33 ms / 1,000 ms |
| コード長 | 633 bytes |
| 記録 | |
| コンパイル時間 | 552 ms |
| コンパイル使用メモリ | 85,516 KB |
| 実行使用メモリ | 61,680 KB |
| 最終ジャッジ日時 | 2026-03-12 05:01:02 |
| 合計ジャッジ時間 | 2,166 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 27 |
ソースコード
import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")
def getlist():
return list(map(int, input().split()))
#処理内容
def main():
N = int(input())
K = int(input())
ans = 0
M = int(K ** 0.5 // 1)
for i in range(1, M + 1):
if K % i == 0:
j = int(K // i)
if i <= N:
a = i - 1
else:
a = max(2 * N - i + 1, 0)
if j <= N:
b = j - 1
else:
b = max(2 * N - j + 1, 0)
# print(i, j, a, b)
if i == j:
ans += a * b
else:
ans += 2 * a * b
print(ans)
if __name__ == '__main__':
main()
双六