如果一个正整数 $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
如果一个正整数 $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}$)。
输出一个整数:问题的答案。
5
2
100
25
| ID | Type | Status | Title | Posted By | Last Updated | Actions |
|---|---|---|---|---|---|---|
| #533 | Editorial | Open | 集训队作业 解题报告 by 卢毅奇 | Qingyu | 2026-01-02 21:50:17 | Download |
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.
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: