Smart agriculture aligns with the principles of sustainable development, making it a crucial direction for the future agriculture. This study focuses on a cooperative plant protection task allocation problem (CPPTAP) of multiple unmanned aerial vehicles (UAVs) with a common deadline in smart agriculture. CPPTAP permits multiple UAVs to conduct pesticide spraying on the same field. The completion time for each task fluctuates due to the cooperation among UAVs. We present a mathematical model and learning-based memetic algorithm (L-MA) to maximize the total area of the fields to be sprayed. In the evolutionary stage, mutation and repair operators based on value information are applied to balance the exploration and exploitation, while a problem-specific local search strategy is designed to enhance exploitation capability. A knowledge-based UAV allocation method (KUAM) is employed to maximize UAV utilization efficiency and minimize conflicts. Throughout the search process, Q-learning is utilized to assist the aforementioned operators and make decisions on the number of cooperative UAVs on fields. The effectiveness of L-MA is validated by comparing it against other state-of-the-art algorithms. The results demonstrate that L-MA outperforms the compared algorithms at a considerable margin in a statistical sense.