当前位置:网站首页>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 .
边栏推荐
- install.img制作方式
- Jetson nano installation tensorflow stepping pit record (scipy1.4.1)
- Array and string processing, common status codes, differences between PHP and JS (JS)
- Sparse matrix storage
- 【学习笔记】Matlab自编高斯平滑器+Sobel算子求导
- C#与MySQL数据库连接
- Business architecture diagram
- 包图画法注意规范
- Animation synchronization of CarSim real-time simulation
- 【学习笔记】反向误差传播之数值微分
猜你喜欢

On November 24, we celebrate the "full moon"

静态库和动态库

Principes fondamentaux de la théorie musicale (brève introduction)

Nacos service registration in the interface

用于类别增量学习的动态可扩展表征 -- DER

【学习笔记】反向误差传播之数值微分

Use of OpenCV 6.4 median filter

Target detection for long tail distribution -- balanced group softmax

Replace self attention with MLP

A brief analysis of graph pooling
随机推荐
AR system summary harvest
CVPR19-Deep Stacked Hierarchical Multi-patch Network for Image Deblurring论文复现
Principes fondamentaux de la théorie musicale (brève introduction)
OpenCV关于x,y坐标容易混淆的心得
Summary of solving the Jetson nano installation onnx error (error: failed building wheel for onnx)
应对长尾分布的目标检测 -- Balanced Group Softmax
VS Code配置问题
Library function of C language
用于类别增量学习的动态可扩展表征 -- DER
常量指针和指针常量
The internal network of the server can be accessed, but the external network cannot be accessed
Carla-UE4Editor导入RoadRunner地图文件(保姆级教程)
最长等比子序列
解决jetson nano安装onnx错误(ERROR: Failed building wheel for onnx)总结
On the back door of deep learning model
How gensim freezes some word vectors for incremental training
OpenCV3 6.2 低通滤波器的使用
install.img制作方式
Wang extracurricular words
The hystrix dashboard reported an error hystrix Stream is not in the allowed list of proxy host names solution