The article analyzes the peculiarities of the Olympiad tasks on computer science: distracting story, placing various important components of the problem in different places of the condition, non-standard mathematical models, non-standard combination of standard approaches, etc. Taking this into account, as well as the rather high complexity of such tasks, there is the problem of working out methodological approaches to teaching to solve such problems. The general schemes of solving the Olympiad tasks on computer science, proposed by various scientists participating in the Olympiad movement, are considered. Based on the own experience, one of them has been selected. One of the areas of dynamic programming, the so-called Knapsack Problems, is considered. There are given various modifications of Knapsack Problem; the ability to solve them is necessary to understand the solution of a more complex task related to dynamic programming. For these tasks are given appropriate mathematical formulas or program code. There are presented all stages of the application of the given scheme to the solving of a specific Olympiad task on computer science, which belongs to the class of Knapsack Problems and proposed by one of the authors at the Open International Student Programming Olympiad “KPI-OPEN 2017” named after S.O. Lebediev and V.M. Glushkov “KPI-OPEN 2017”: the analysis of the condition, the construction of a mathematical model, the construction of a general scheme of solving, refinement, implementation, testing and debugging, sending the program to check. An effective author’s method for solving this task is demonstrated. The program code for the solution is given in C++. It is noted that the important point in preparing for the Olympiads on computer science is the analysis of the tasks after the completion of each competition. Applying the proposed methodological approaches to training pupils or students for the Olympiads on computer science (programming), in our opinion, will increase the effectiveness of such training.