Giter Site home page Giter Site logo

kamyu104 / googlekickstart-2021 Goto Github PK

View Code? Open in Web Editor NEW
83.0 8.0 27.0 166 KB

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

License: MIT License

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

googlekickstart-2021's Introduction

  • Python solutions of Google Kick Start 2021. Solution begins with * means it will get TLE in the largest data set.
  • Total computation amount > 10^8 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.
  • From 2021-04, PyPy3 is supported by the online judge.
  • From 2021-11, Python2/PyPy2 is no longer supported by the online judge.
  • You need to run 2to3 -n -W --add-suffix=3 solution.py to convert the solution into Python3/PyPy3.

Rounds

Round A

# Title Solution Time Space Difficulty Tag Note
A K-Goodness String Python O(N) O(1) Easy String
B L Shaped Plots Python O(R * C) O(min(R, C)) Easy DP
C Rabbit House Python O(R * C) O(R * C) Medium Bucket Sort, BFS
D Checksum Python O(N^2) O(N^2) Hard MST, Prim's Algorithm

Round B

# Title Solution Time Space Difficulty Tag Note
A Increasing Substring Python O(N) O(1) Easy String
B Longest Progression Python Python O(N) O(1) Medium DP
C Consecutive Primes Python O(N^(1/4) * MAX_GAP) O(1) Medium Math, Prime Gap
D Truck Delivery PyPy O((N + Q) * (logN + log(MAX_A))) O(N) Hard DFS, Segment Tree

Round C

# Title Solution Time Space Difficulty Tag Note
A Smaller Strings Python O(N) O(1) Easy Math, Counting
B Alien Generator Python O(sqrt(G)) O(1) Easy Math, Arithmetic Progression
C Rock Paper Scissors Python Python O(N) O(1) Medium Math, Expected Value, DP, Backtracing, Precompute
D Binary Operator Python Python Python O(N * E) O(N * E) Hard Math, Polynomial Calculator, Hash

Round D

# Title Solution Time Space Difficulty Tag Note
A Arithmetic Square Python O(1) O(1) Easy Math, Counting
B Cutting Intervals Python O(NlogN) O(N) Medium Line Sweep, Greedy
C Final Exam PyPy PyPy O(NlogN + M * log(N + M)) O(N + M) Medium Skip List, Sorted List, Binary Search
D Primes and Queries Python Python O(N * (logN + log(log(MAX_A))) + Q * (logN + log(log(MAX_VAL)) + log(log(MAX_S)))) O(N) Hard BIT, Fenwick Tree, LTE, Lifting The Exponent Lemma, Binary Search

Round E

# Title Solution Time Space Difficulty Tag Note
A Shuffled Anagrams Python O(N) O(N) Easy String, Grouping
B Birthday Cake Python O(1) O(1) Hard Math, Greedy
C Palindromic Crossword Python Python Python O(N * M) O(N * M) Easy Graph, BFS, DFS, Union Find
D Increasing Sequence Card Game Python precompute: O(EPS^(-1))
runtime: O(1)
O(EPS^(-1)) Medium Math, Expected Value, Harmonic Series, DP, Precompute, Series Estimation with Integrals

Round F

# Title Solution Time Space Difficulty Tag Note
A Trash Bins Python O(N) O(N) Easy DP
B Festival Python PyPy Python Python O(NlogN) O(N) Easy Line Sweep, BIT, Fenwick Tree, Skip List, Sorted List, Heap
C Star Trappers PyPy Python O(N^3) O(1) Medium Math, Geometry
D Graph Travel Python O(M + N * 2^N) O(2^N) Medium DP, Bitmask

Round G

# Title Solution Time Space Difficulty Tag Note
A Dogs and Cats Python Python O(N) O(1) Easy Simulation
B Staying Hydrated Python Python Python O(K) on average O(K) Easy Prefix Sum, Binary Search, Math, Median, Quick Select
C Banana Bunches PyPy O(N^2) O(min(N^2, K)) Medium Two Pointers, DP
D Simple Polygon Python Python O(N) O(1) Hard Math, Pick's Theorem, Constructive Algorithms

Round H

# Title Solution Time Space Difficulty Tag Note
A Transform the String Python Python O(N) O(1) Easy String
B Painter Python Python O(N) O(1) Easy Greedy
C Silly Substitutions Python Python O(N) O(N) Medium Simulation, Linked List
D Dependent Events Python Python Python O(NlogN + QlogN) O(NlogN) Hard Euler's Theorem, Fermat's Little Theorem, Probability, DFS, LCA, Tree Ancestors (Binary Lifting), Tarjan's Offline LCA Algorithm, DP

googlekickstart-2021'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  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  avatar  avatar

googlekickstart-2021's Issues

Round E Competition

Hi there. I'm new to Kickstart and I was wondering if you did go through Round E? I'd love to learn from your code so that I can grow as a programmer. Thank you very much.

Bro Code is not Excecuting

File "/home/niranjan/Desktop/Code/first.py", line 28
print 'Case #%d: %s' % (case+1, l_shaped_plots())
^
SyntaxError: invalid syntax

Writing the solution in Python 3

Hi! I noticed that the solutions are written in Python 2. If I am able to rewrite them into Python 3 during my studies, may I contribute them to this repository? How should I structure the directories?

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.