Tags:C++, matrix, olympiad tasks, programming and sequence
Abstract:
The article discusses three approaches to reducing runtime of the programs, which are solutions of Olympiad tasks on computer science, related to sequences or matrices. The first approach is based on the representation of some sequences in matrix form and then the program of calculating the members of the sequence will have asymptotics equal to the time complexity of the exponentiation algorithm and will be O(log (n)). The second approach is to upgrade the known code to obtain significant reduction of the program runtime. The third approach is based on reducing time complexity by search for regularities; the author's task is presented and this approach is used to solve it.
Reduction of Programs Execution Time for Tasks Related to Sequences or Matrices