Currently, maritime search and rescue (MSR) is mainly depending on the search party, while the searching objects are waiting passively. Therefore, a new method of MSR which is based on the wireless sensor network (WSN) techniques is proposed in this paper. WSN could be self-organized into network and transmit nodes information, such as position information, for search party to accomplish the search and rescue work. However, the application encounters the problems of dynamic adaptability and life cycle limitation at sea. An energy dynamic distribution and optimization algorithm (EDDO), which is based on genetic algorithm (GA), is presented to handle with these problems. The algorithm satisfies the connectivity and energy saving of the network, and the GA with elitism-based immigrants approach is put forward to optimize the poor individuals when the positions of some nodes have changed. Simulation results show that the algorithm can quickly adapt to a dynamic network and reduce energy consumption at the same time.