当前位置:网站首页>Force deduction method summary: find classes
Force deduction method summary: find classes
2022-07-02 08:09:00 【Villanelle#】
436. Look for the right range Medium lower_bound
Method 2021/11/10
Give you an interval array intervals , among intervals[i] = [starti, endi] , And each starti all Different .
Section i Of Right section It can be recorded as an interval j , And satisfy startj >= endi , And startj To minimize the .
Returns an interval consisting of each interval i Of Right section stay intervals An array of corresponding subscripts in . If a certain interval i There is no corresponding Right section , Then subscript i The value at is set to -1 .
Example :
Input :intervals = [[3,4],[2,3],[1,2]]
Output :[-1,0,1]
explain : about [3,4] , There is no such thing as “ On the right side ” Section .
about [2,3] , Section [3,4] Have the smallest “ Right ” The starting point ;
about [1,2] , Section [2,3] Have the smallest “ Right ” The starting point .
utilize map Press... Automatically when the container is inserted key Nature of sorting , Use map Container storage intervals The left interval value and the corresponding subscript in , When traversing each interval , Use map In container lower_bound
How to find key In the first >= Iterator of its right interval value , Its second Value is its subscript .
边栏推荐
- 浅谈深度学习模型中的后门
- Open3d learning notes II [file reading and writing]
- Carsim-问题Failed to start Solver: PATH_ID_OBJ(X) was set to Y; no corresponding value of XXXXX?
- [binocular vision] binocular stereo matching
- 浅谈深度学习中的对抗样本及其生成方法
- 稀疏矩阵存储
- AR system summary harvest
- 高中数学必修一
- Principes fondamentaux de la théorie musicale (brève introduction)
- Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)
猜你喜欢
OpenCV 6.4 中值滤波器的使用
Where do you find the materials for those articles that have read 10000?
Matlab数学建模工具
Income in the first month of naked resignation
Carsim-路面3D形状文件参数介绍
联邦学习下的数据逆向攻击 -- GradInversion
Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
Chinese garbled code under vscade
静态库和动态库
Carla-ue4editor import Roadrunner map file (nanny level tutorial)
随机推荐
Eklavya -- infer the parameters of functions in binary files using neural network
Replace convolution with full connection layer -- repmlp
Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
Opencv3 6.3 reduced pixel sampling with filters
Chinese garbled code under vscade
How to wrap qstring strings
针对语义分割的真实世界的对抗样本攻击
【MagNet】《Progressive Semantic Segmentation》
Sqlyog remote connection to MySQL database under centos7 system
Graph Pooling 简析
Global and Chinese markets for conventional rubber track 2022-2028: Research Report on technology, participants, trends, market size and share
Brief introduction of prompt paradigm
MySQL optimization
用全连接层替代掉卷积 -- RepMLP
WCF更新服务引用报错的原因之一
Open3d learning note 4 [surface reconstruction]
Specification for package drawing
Static library and dynamic library
【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
Vscode下中文乱码问题