当前位置:网站首页>Sort custom function
Sort custom function
2022-07-01 01:32:00 【Weiyang acridine】
Define a two-dimensional array
vector<vector<int>> ret;
(1) Press two-dimensional array ret[i][1] The size of is arranged from large to small
static bool cmp(vector<int> &m, vector<int> &n) {
retutn m[1] > n[1]; // Represents a two-dimensional array
}
sort(ret.begin(), ret.end(), cmp)
(2) Press two-dimensional array ret[i][1] The size of is arranged from small to large ( Force buckle platform not used static Will make mistakes ,sort Request to static)
static bool cmp(vector<int> &m, vector<int> &n) {
retutn m[1] < n[1]; // Represents a two-dimensional array
}
边栏推荐
- 使用 C# 创造 ASCII 艺术
- System.CommandLine版CSRebot
- Using recyclerreview to show banner is very simple
- OCR的一些项目
- New opportunities for vr/ar brought by metauniverse
- Why build a personal blog
- 迪赛智慧数——其他图表(平行坐标图):2021年应届专业就业情况
- Unknown database connection database error
- Open3d point cloud bounding box
- One of the basics - overview of sta Basics
猜你喜欢

Install redis database and download redis Desktop Manager in win11
![Parity linked list [two general directions of linked list operation]](/img/4e/ce860bc172bb75f456427ba26a7842.png)
Parity linked list [two general directions of linked list operation]

Installing mongodb database in Windows Environment

Why not two or four TCP handshakes

Docker deployment MySQL 8

Unknown database connection database error

1500w播放下还藏着什么热点?B站2个未来趋势你不得错过

Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base

亲测有效,快速创建JMeter桌面快捷方式

gin_gorm
随机推荐
Kongyiji's first question: how much do you know about service communication?
What will Web3 bring in the future?
Strictmode jamming and leakage detection -strictmode principle (2)
Open3d point cloud bounding box
Note d'étude du DC: zéro dans le chapitre officiel - - Aperçu et introduction du processus de base
【队列】933. Number of Recent Calls
软件开发完整流程
[problem handled] -nvidia SMI command cannot obtain the GPU process number of its own container and the external GPU process number
工作6年,来盘点一下职场人混迹职场的黄金法则
【多源bfs】934. Shortest Bridge
gin_ gorm
Strictmode analysis registration strictmode principle (4)
个人博客搭建与美化
gin 配置文件
Construction and beautification of personal blog
Institute of Microbiology, commonly used biochemical reactions in microbiological testing
WIN11中MathType编辑中“打开数学输入面板”是灰色不可编辑
为什么要搭建个人博客
【Qt5-基础篇_1】从0开始,德天老师和你一起学习——窗口简介
MFC TCP通信服务端客户端Demo备忘vs2019