Skip to content

zinchse/_yt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Here you can find solution (on python) to all problems for [Yandex Training 3.0]

File template.py is designed so you don't have to worry about input and output speed (this is done automatically as fast as possible). Yes, in some tasks this is important...

💫 "Tricks"

Top of my conclusions on this context:

  • input/output is an indispensable part of the task; you need to think about how fast you read and write data; that's what I wrote the template.py to combat this problem (it is an adoptation of @Slamurs [template])

  • the problem's input limits are the most important information in the problem's condition; you can use them to figure out the asymptotic required solution (assume that python can handle 10^7 operations; then a n * n solution with an input complexity of 10 000 is not even worth writing, while n * logn is fine)

  • even simple arithmetic operations can be saved (for example, if suddenly within a loop you repeatedly step to elements at some distance, for example d * * 3, then by storing this value at each iteration in the shift variable, you can significantly speed up the program

  • iterating over rows and columns in a matrix, if they are represented by a list of lists, is not the same thing; (yes, this is quite a basic rule, but once in an asymptotically optimal solution I ran into this, and for a long time I could not understand what solution the authors of the problem expected from me... the reason for this phenomenon is the physical arrangement of array memory elements and random access speed)

About

Yandex Training 3.0, all .py solutions for olymp tier

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages