1 Star 41 Fork 18

小墨/力扣题库(完整版)

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
到达终点 [reaching-points].html 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
小墨 提交于 2022-03-29 12:43 +08:00 . update
<p>给定四个整数&nbsp;<code>sx</code>&nbsp;,&nbsp;<code>sy</code>&nbsp;<code>tx</code>&nbsp;&nbsp;<code>ty</code>,如果通过一系列的<strong>转换</strong>可以从起点&nbsp;<code>(sx, sy)</code>&nbsp;到达终点&nbsp;<code>(tx, ty)</code>,则返回 <code>true</code>,否则返回&nbsp;<code>false</code></p>
<p>从点&nbsp;<code>(x, y)</code>&nbsp;可以<strong>转换</strong>&nbsp;<code>(x, x+y)</code>&nbsp; 或者&nbsp;<code>(x+y, y)</code></p>
<p>&nbsp;</p>
<p><strong>示例 1:</strong></p>
<pre>
<strong>输入:</strong> sx = 1, sy = 1, tx = 3, ty = 5
<strong>输出:</strong> true
<strong>解释:
</strong>可以通过以下一系列<strong>转换</strong>从起点转换到终点:
(1, 1) -&gt; (1, 2)
(1, 2) -&gt; (3, 2)
(3, 2) -&gt; (3, 5)
</pre>
<p><strong>示例 2:</strong></p>
<pre>
<strong>输入:</strong> sx = 1, sy = 1, tx = 2, ty = 2
<strong>输出:</strong> false
</pre>
<p><strong>示例 3:</strong></p>
<pre>
<strong>输入:</strong> sx = 1, sy = 1, tx = 1, ty = 1
<strong>输出:</strong> true
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= sx, sy, tx, ty &lt;= 10<sup>9</sup></code></li>
</ul>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/coder-xiaomo/leetcode-problemset.git
git@gitee.com:coder-xiaomo/leetcode-problemset.git
coder-xiaomo
leetcode-problemset
力扣题库(完整版)
master

搜索帮助