Giter Site home page Giter Site logo

kamyu104 / googlekickstart-2020 Goto Github PK

View Code? Open in Web Editor NEW
42.0 6.0 15.0 134 KB

๐Ÿƒ Python Solutions of All 32 Problems in GKS 2020

License: MIT License

Python 100.00%
competitive-programming google-kickstart google-kick-start google-kickstart-2020 contest-programming python algorithm kickstart

googlekickstart-2020's Introduction

Python solutions of Google Kick Start 2020. Solution begins with * means it will get TLE in the largest data set (total computation amount > 10^8, which is not friendly for Python to solve in 5 ~ 15 seconds). A problem was marked as Very Hard means that it was an unsolved one during the contest and may not be that difficult.

Round A

# Title Solution Time Space Difficulty Tag Note
A Allocation Python O(N) O(MAX_A) Easy Greedy, Counting Sort
B Plates Python O(N * P * K) O(P) Easy DP, Prefix Sum
C Workout Python O(Nlog(MAX_DIFF)) O(1) Easy Binary Search, Greedy
D Bundling Python O(N * L) O(T) Medium Trie, Greedy, DFS, Stack

Round B

# Title Solution Time Space Difficulty Tag Note
A Bike Tour Python O(N) O(1) Easy Array
B Bus Routes Python O(N) O(1) Easy Greedy
C Robot Path Decoding Python O(N) O(N) Easy Stack
D Wandering Robot Python Python O(W + H) O(W + H) Hard Binomial Coefficients, Probability, Log Representation, Prefix Sum

Round C

# Title Solution Time Space Difficulty Tag Note
A Countdown Python O(N) O(1) Easy Array
B Stable Wall Python O(R * C) O(1) Easy Topological Sort, DFS
C Perfect Subarray PyPy O(N * sqrt(N * MAX_A)) O(N * MAX_A) Medium Math, Prefix Sum
D Candies Python O(N + QlogN) O(N) Medium BIT, Fenwick Tree

Round D

# Title Solution Time Space Difficulty Tag Note
A Record Breaker Python O(N) O(1) Easy Array
B Alien Piano Python O(K) O(1) Easy Greedy
C Beauty of Tree Python O(N) O(N) Medium DFS, Math
D Locked Doors PyPy O(NlogN + QlogN) O(N) Hard Cartesian Tree, Binary Lifting

Round E

# Title Solution Time Space Difficulty Tag Note
A Longest Arithmetic Python O(N) O(1) Easy Array
B High Buildings Python O(N) O(N) Easy Constructive Algorithms
C Toys Python O(NlogN) O(N) Medium Greedy, Heap
D Golden Stone Python Python O((N * S + M * S + R * N) * log(N * S)) O(N * S + M) Hard Dijkstra's Algorithm

Round F

# Title Solution Time Space Difficulty Tag Note
A ATM Queue Python O(NlogN) O(1) Easy Sort
B Metal Harvest Python O(NlogN) O(1) Easy Sort
C Painters' Duel Python O(2^(S^2)) O(2^(S^2)) Medium Memoization, Alpha Beta Pruning
D Yeetzhee Python O(M * S) O(M * S) Hard Math, Expected Value, Memoization, Greedy

Round G

# Title Solution Time Space Difficulty Tag Note
A Kick_Start Python O(N) O(1) Easy Math
B Maximum Coins Python Python O(N^2) O(1) Easy Matrix
C Combination Lock Python Python O(WlogW) O(1) Easy Math, Median, Prefix Sum
D Merge Cards Python Python O(N) O(N) Medium Math, Expected Value, DP, Precompute, Prefix Sum

Round H

# Title Solution Time Space Difficulty Tag Note
A Retype Python O(1) O(1) Easy Math
B Boring Numbers Python O(logR) O(1) Easy Math
C Rugby Python O(NlogN) O(N) Medium Math, Median
D Friends PyPy PyPy O(A^3 + L^2 * (N + Q)) O(A^2) Medium Floyd-Warshall Algorithm

googlekickstart-2020's People

Contributors

kamyu104 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.