1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/统计平方和三元组的数目 [count-square-sum-triples].html
2022-03-29 12:43:11 +08:00

28 lines
853 B
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<p>一个 <strong>平方和三元组</strong> <code>(a,b,c)</code> 指的是满足 <code>a<sup>2</sup> + b<sup>2</sup> = c<sup>2</sup></code> 的 <strong>整数 </strong>三元组 <code>a</code><code>b</code> 和 <code>c</code> 。</p>
<p>给你一个整数 <code>n</code> ,请你返回满足<em> </em><code>1 &lt;= a, b, c &lt;= n</code> 的 <strong>平方和三元组</strong> 的数目。</p>
<p> </p>
<p><strong>示例 1</strong></p>
<pre><b>输入:</b>n = 5
<b>输出:</b>2
<b>解释:</b>平方和三元组为 (3,4,5) 和 (4,3,5) 。
</pre>
<p><strong>示例 2</strong></p>
<pre><b>输入:</b>n = 10
<b>输出:</b>4
<b>解释:</b>平方和三元组为 (3,4,5)(4,3,5)(6,8,10) 和 (8,6,10) 。
</pre>
<p> </p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 250</code></li>
</ul>