QOJ.ac

QOJ

时间限制: 2.0 s 内存限制: 512 MB 总分: 100 可 Hack ✓

#12331. Jimp Numbers

统计

如果一个正整数 $k$ 满足存在唯一的一组正整数三元组 $(a, b, c)$,使得 $a, b, c$ 构成等差数列(按此顺序),且满足 $a^2 + b^2 + k = c^2$,则称 $k$ 为一个 jimp 数。

计算不超过给定整数 $n$ 的 jimp 数的个数。

输入格式

仅一行,包含一个整数 $n$ ($1 \le n \le 10^{11}$)。

输出格式

输出一个整数:问题的答案。

样例

样例输入 1

5

样例输出 1

2

样例输入 2

100

样例输出 2

25

Editorials

IDTypeStatusTitlePosted ByLast UpdatedActions
#533Editorial Open集训队作业 解题报告 by 卢毅奇Qingyu2026-01-02 21:50:17 Download

Discussions

About Discussions

The discussion section is only for posting: General Discussions (problem-solving strategies, alternative approaches), and Off-topic conversations.

This is NOT for reporting issues! If you want to report bugs or errors, please use the Issues section below.

Open Discussions 0
No discussions in this category.

Issues

About Issues

If you find any issues with the problem (statement, scoring, time/memory limits, test cases, etc.), you may submit an issue here. A problem moderator will review your issue.

Guidelines:

  1. This is not a place to publish discussions, editorials, or requests to debug your code. Issues are only visible to you and problem moderators.
  2. Do not submit duplicated issues.
  3. Issues must be filed in English or Chinese only.
Active Issues 0
No issues in this category.
Closed/Resolved Issues 0
No issues in this category.