Earthquakes pose significant risks to national stability, endangering lives and causing substantial economic damage. This study tackles the urgent need for efficient post-earthquake relief in search and rescue (SAR) scenarios by proposing a multi-UAV cooperative rescue task allocation model. With consideration the unique requirements of post-earthquake rescue missions, the model aims to minimize the number of UAVs deployed, reduce rescue costs, and shorten the duration of rescue operations. We propose an innovative hybrid algorithm combining particle swarm optimization (PSO) and grey wolf optimizer (GWO), called the PSOGWO algorithm, to achieve the objectives of the model. This algorithm is enhanced by various strategies, including interval transformation, nonlinear convergence factor, individual update strategy, and dynamic weighting rules. A practical case study illustrates the use of our model and algorithm in reality and validates its effectiveness by comparing it to PSO and GWO. Moreover, a sensitivity analysis on UAV capacity highlights its impact on the overall rescue time and cost. The research results contribute to the advancement of vehicle-routing problem (VRP) models and algorithms for post-earthquake relief in SAR. Furthermore, it provides optimized relief distribution strategies for rescue decision-makers, thereby improving the efficiency and effectiveness of SAR operations.