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
, 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.
# | 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 |
# | 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 + R) * log(min(MAX_L, MAX_W))) | O(min(MAX_L, MAX_W)) | Hard | DFS, Segment Tree |