mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-07 00:11:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个二维矩阵 <code>matrix</code> 和一个整数 <code>k</code> ,矩阵大小为 <code>m x n</code> 由非负整数组成。</p>\n\n<p>矩阵中坐标 <code>(a, b)</code> 的 <strong>值</strong> 可由对所有满足 <code>0 <= i <= a < m</code> 且 <code>0 <= j <= b < n</code> 的元素 <code>matrix[i][j]</code>(<strong>下标从 0 开始计数</strong>)执行异或运算得到。</p>\n\n<p>请你找出 <code>matrix</code> 的所有坐标中第 <code>k</code> 大的值(<strong><code>k</code> 的值从 1 开始计数</strong>)。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>matrix = [[5,2],[1,6]], k = 1\n<strong>输出:</strong>7\n<strong>解释:</strong>坐标 (0,1) 的值是 5 XOR 2 = 7 ,为最大的值。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>matrix = [[5,2],[1,6]], k = 2\n<strong>输出:</strong>5\n<strong>解释:</strong>坐标 (0,0) 的值是 5 = 5 ,为第 2 大的值。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>matrix = [[5,2],[1,6]], k = 3\n<strong>输出:</strong>4\n<strong>解释:</strong>坐标 (1,0) 的值是 5 XOR 1 = 4 ,为第 3 大的值。</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre><strong>输入:</strong>matrix = [[5,2],[1,6]], k = 4\n<strong>输出:</strong>0\n<strong>解释:</strong>坐标 (1,1) 的值是 5 XOR 2 XOR 1 XOR 6 = 0 ,为第 4 大的值。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == matrix.length</code></li>\n\t<li><code>n == matrix[i].length</code></li>\n\t<li><code>1 <= m, n <= 1000</code></li>\n\t<li><code>0 <= matrix[i][j] <= 10<sup>6</sup></code></li>\n\t<li><code>1 <= k <= m * n</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 86,
|
||||
"likes": 87,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -173,7 +173,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"29.4K\", \"totalSubmission\": \"45K\", \"totalAcceptedRaw\": 29388, \"totalSubmissionRaw\": 44971, \"acRate\": \"65.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"29.6K\", \"totalSubmission\": \"45.3K\", \"totalAcceptedRaw\": 29577, \"totalSubmissionRaw\": 45347, \"acRate\": \"65.2%\"}",
|
||||
"hints": [
|
||||
"Use a 2D prefix sum to precalculate the xor-sum of the upper left submatrix."
|
||||
],
|
||||
|
Reference in New Issue
Block a user