New classes of problems in the optimal control theory are mainly represented by practice problems. A few controlled processes (astronautics, chemical production, robotics, biological populations) with structures changing over time have been discovered. Representatives of various scientific bodies developed new mathematical models and formulations of optimal control problems. They proposed new methods with new names, and one of the common term used is hybrid systems. The paper presents one of these classes: discrete-continuous systems (DCS) containing two levels. We investigate the situation when, in addition to the general traditional functional, each lower-level subsystem of the mathematical model has its own goal. Moreover, the moments of the end of the subsystem action stages are not fixed and require determination within a given functioning interval of the entire system. To develop an algorithm for solving the problem, an analog of Krotov sufficient optimality conditions is used. This method allows determining the end stages of these subsystems’ functioning. The obtained algorithm is tested against an ecological and economic example.