GithubHelp home page GithubHelp logo

_yt's Introduction

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)

_yt's People

Contributors

zinchse avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.