mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
42 lines
1.5 KiB
HTML
42 lines
1.5 KiB
HTML
<p>给你两个整数数组 <code>nums1</code> 和 <code>nums2</code>,长度分别为 <code>n</code> 和 <code>m</code>。同时给你一个<strong>正整数</strong> <code>k</code>。</p>
|
||
|
||
<p>如果 <code>nums1[i]</code> 可以被 <code>nums2[j] * k</code> 整除,则称数对 <code>(i, j)</code> 为 <strong>优质数对</strong>(<code>0 <= i <= n - 1</code>, <code>0 <= j <= m - 1</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">nums1 = [1,3,4], nums2 = [1,3,4], k = 1</span></p>
|
||
|
||
<p><strong>输出:</strong><span class="example-io">5</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>5个优质数对分别是 <code>(0, 0)</code>, <code>(1, 0)</code>, <code>(1, 1)</code>, <code>(2, 0)</code>, 和 <code>(2, 2)</code>。</p>
|
||
</div>
|
||
|
||
<p><strong class="example">示例 2:</strong></p>
|
||
|
||
<div class="example-block">
|
||
<p><strong>输入:</strong><span class="example-io">nums1 = [1,2,4,12], nums2 = [2,4], k = 3</span></p>
|
||
|
||
<p><strong>输出:</strong><span class="example-io">2</span></p>
|
||
|
||
<p><strong>解释:</strong></p>
|
||
|
||
<p>2个优质数对分别是 <code>(3, 0)</code> 和 <code>(3, 1)</code>。</p>
|
||
</div>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= n, m <= 50</code></li>
|
||
<li><code>1 <= nums1[i], nums2[j] <= 50</code></li>
|
||
<li><code>1 <= k <= 50</code></li>
|
||
</ul>
|