当前位置:网站首页>1051. 高度检查器
1051. 高度检查器
2022-06-13 11:14:00 【anieoo】
原题链接:1051. 高度检查器
solution:
排序+比较
class Solution {
public:
int heightChecker(vector<int>& heights) {
vector<int> exp = heights;
sort(exp.begin(),exp.end());
int res = 0;
for(int i = 0;i < exp.size();i++) {
if(exp[i] != heights[i]) res++;
}
return res;
}
};
边栏推荐
- Vivo large scale kubernetes cluster automation operation and maintenance practice
- 5.5 clock screensaver
- 统计特殊子序列数目(0,1,2)DP
- 音视频技术开发周刊 | 249
- [tcapulusdb knowledge base] Introduction to tmonitor background one click installation (I)
- Codeforces Round #798 (Div. 2)ABCD
- Socket programming (medium)
- 领导说要明天上线,这货压根不知道开发流程
- F2. nearest beautiful number (hard version)
- Web 3.0?高成本版的P2P而已
猜你喜欢
Miidock file distribution
宝塔访问从IP改为域名
Euler function and finding Euler function by linear sieve
ue5 小知识点 geometry script modeling
第七章 文件管理作业
[tcapulusdb knowledge base] Introduction to tmonitor stand-alone installation guidelines (II)
宝塔中navicat连接mysql
Chapter VII document management
Redis related
元宇宙土地:是什么让数字房地产变得有价值
随机推荐
Apache APISIX v2.14.1 探索性版本发布,进军更多领域
Tamidog knowledge | a comprehensive analysis of the meaning and role of mergers and acquisitions of state-owned enterprises
vivo大规模 Kubernetes 集群自动化运维实践
容斥原理(能被整除的数)
报告录屏+PPT 傅云飞-喜马拉雅山脉南坡云降水特征研究
Socket programming (Part 1)
MFC自定义button实现颜色控制
【ROS】MoveIt-rviz-七自由度机械臂仿真
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
State compression DP example (traveling salesman problem and rectangle filling problem)
Vivo large scale kubernetes cluster automation operation and maintenance practice
MFC custom button to realize color control
宝塔访问从IP改为域名
【TcaplusDB知识库】TcaplusDB机型管理介绍
Implementation of singleton mode
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
【TcaplusDB知识库】Tmonitor系统升级介绍
22、ADS使用记录之E类功放设计(下)
高斯消元求n元方程组
Euler function and finding Euler function by linear sieve