With the wave of artificial intelligence sweeping the world in recent years, UAVs is widely used in various fields. UAV path planning has attracted much attention from scientists as an essential part of UAV work. In order to design an efficient and reasonable 3D UAV path planning program, recent researchers have invented and improved many algorithms. This paper proposes an elite RIME algorithm for 3D UAV path planning. First, we propose an elite reverse learning population selection strategy based on piecewise mapping to enhance the population diversity of the algorithm for better exploration. Second, this paper proposes a stochastic factor-controlled elite pool exploration strategy so that the algorithm is difficult to enter the local optimum and can better explore the global optimum. Then, this paper proposes a hard frost puncture exploitation strategy based on the sine–cosine function so that the algorithm can find the global optimum faster during the exploitation process. Meanwhile, in order to test the performance of the algorithm proposed in this paper, we compare it with 13 other intelligent optimization algorithms that are classical and popular nowadays on 52 test functions in three test sets, CEC2017, CEC2020, and CEC2022, and obtain competitive results. Finally, we applied it to the 3D UAV path planning problem in three different terrain scenarios, and the ELRIME algorithm achieved good results in all of them. Especially in the 7-peak model, the ELRIME algorithm improves the performance of the RIME algorithm by a factor of two. In the 9-peak model, the average value aspect also reduce the cost by 91 compared to the RIME algorithm, and more importantly, it has the smallest fluctuation in 30 runs, which is among the most stable of all the compared algorithms. In the 12-peak model, its stability is also significantly enhanced, and in terms of worst-case cost, it improves the cost by 340 compared to RIME.