mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-09 09:21:40 +08:00
41 lines
1.8 KiB
HTML
41 lines
1.8 KiB
HTML
<p>给你一个整数数组 <code>nums</code>,其中包含的正整数 <strong>互不相同 </strong>,另给你一个整数 <code>target</code>。</p>
|
||
|
||
<p>请判断是否可以将 <code>nums</code> 分成两个 <strong>非空</strong>、<strong>互不相交 </strong>的 <strong>子集 </strong>,并且每个元素必须 <strong>恰好 </strong>属于 <strong>一个 </strong>子集,使得这两个子集中元素的乘积都等于 <code>target</code>。</p>
|
||
|
||
<p>如果存在这样的划分,返回 <code>true</code>;否则,返回 <code>false</code>。</p>
|
||
|
||
<p><strong>子集 </strong>是数组中元素的一个选择集合。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong class="example">示例 1:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong> <span class="example-io">nums = [3,1,6,8,4], target = 24</span></p>
|
||
|
||
<p><strong>输出:</strong> <span class="example-io">true</span></p>
|
||
|
||
<p><strong>解释:</strong>子集 <code>[3, 8]</code> 和 <code>[1, 6, 4]</code> 的乘积均为 24。因此,输出为 true 。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 2:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong> <span class="example-io">nums = [2,5,3,7], target = 15</span></p>
|
||
|
||
<p><strong>输出:</strong> <span class="example-io">false</span></p>
|
||
|
||
<p><strong>解释:</strong>无法将 <code>nums</code> 划分为两个非空的互不相交子集,使得它们的乘积均为 15。因此,输出为 false。</p>
|
||
</div>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>3 <= nums.length <= 12</code></li>
|
||
<li><code>1 <= target <= 10<sup>15</sup></code></li>
|
||
<li><code>1 <= nums[i] <= 100</code></li>
|
||
<li><code>nums</code> 中的所有元素互不相同。</li>
|
||
</ul>
|