mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-08 16:54:50 +08:00
Update 0406.根据身高重建队列.md
Use ref
This commit is contained in:
@ -101,7 +101,7 @@ C++代码如下:
|
|||||||
// 版本一
|
// 版本一
|
||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
static bool cmp(const vector<int> a, const vector<int> b) {
|
static bool cmp(const vector<int>& a, const vector<int>& b) {
|
||||||
if (a[0] == b[0]) return a[1] < b[1];
|
if (a[0] == b[0]) return a[1] < b[1];
|
||||||
return a[0] > b[0];
|
return a[0] > b[0];
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ public:
|
|||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
// 身高从大到小排(身高相同k小的站前面)
|
// 身高从大到小排(身高相同k小的站前面)
|
||||||
static bool cmp(const vector<int> a, const vector<int> b) {
|
static bool cmp(const vector<int>& a, const vector<int>& b) {
|
||||||
if (a[0] == b[0]) return a[1] < b[1];
|
if (a[0] == b[0]) return a[1] < b[1];
|
||||||
return a[0] > b[0];
|
return a[0] > b[0];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user