GoogleKickStart 2022 [](./LICENSE)

April 17, 2023 ยท View on GitHub

  • Python3 solutions of Google Kick Start 2022. Solution begins with * means it will get TLE in the largest data set.
  • Total computation amount > 10^8 is not friendly for Python3 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.

Rounds

Round A

#TitleSolutionTimeSpaceDifficultyTagNote
ASpeed TypingPython3O(|P|)O(1)EasyString
BChallenge NinePython3O(logN)O(logN)EasyMath, Greedy
CPalindrome Free StringsPython3 Python3O(N)O(1)MediumBacktracking, DP
DInteresting IntegersPython3 Python3precompute: O(2835 * log(MAX_B)^2)
runtime: O(9 * (logB)^2)
O(2835 * log(MAX_B)^2)HardCounting, Memoization

Round B

#TitleSolutionTimeSpaceDifficultyTagNote
AInfinity AreaPython3O(logR)O(1)EasyMath
BPalindromic FactorsPython3O(sqrt(A) * logA)O(1)EasyMath, String
CUnlock the PadlockPython3O(N^2)O(N^2)MediumMemoization
DHamiltonian TourPython3 PyPy3 Python3O(R * C)O(R * C)HardDFS, Constructive Algorithms, BFS, Spanning Tree, Wall Follower

Round C

#TitleSolutionTimeSpaceDifficultyTagNote
ANew PasswordPython3O(N)O(1)EasyString
BRange PartitionPython3O(N)O(1)EasyMath, Greedy
CAnts on a StickPython3 Python3O(NlogN)O(N)MediumSort, Deque
DPalindromic DeletionsPyPy3O(N^3)O(N^2)HardMath, Expected Value, Combinatorics, DP, Inclusion-Exclusion Principle

Round D

#TitleSolutionTimeSpaceDifficultyTagNote
AImage LabelerPython3 Python3O(N) on averageO(1)EasyGreedy, Sort, Quick Select
BMaximum GainPyPy3 PyPy3O(K^2 + N + M)O(1)EasyPrefix Sum, Sliding Window, Brute Force
CTouchbar TypingPyPy3O(N * M)O(N * M)MediumGreedy, DP
DSuspects and WitnessesPyPy3O(N * K)O(K)HardLogic-Based, Graph, BFS

Round E

#TitleSolutionTimeSpaceDifficultyTagNote
AColoring GamePython3O(1)O(1)EasyGreedy, Math
BStudents and MentorsPython3 Python3O(NlogN)O(N)EasySort, Binary Search, Two Pointers
CMatching PalindromePython3 Python3 Python3O(N)O(N)MediumBrute Force, Manacher's Algorithm, KMP Algorithm
DPizza DeliveryPython3O(M * N^2 * 2^P)O(N^2 * 2^P)HardBFS, DP

Round F

#TitleSolutionTimeSpaceDifficultyTagNote
ASort the FabricsPython3O(MAX_C * NlogN)O(MAX_C * N)EasySort
BWater Container SystemPython3O(N)O(N)EasyBFS
CStory of SeasonsPython3 Python3O(NlogN)O(N)MediumGreedy, Heap
DScheduling a MeetingPython3O(D + N + M)O(D + N + M)HardLine Sweep, Greedy

Round G

#TitleSolutionTimeSpaceDifficultyTagNote
AWalktoberPython3O(M * N)O(N)EasyArray
BCurlingPython3O(N + M)O(N + M)EasyArray
CHappy SubarraysPython3 Python3O(N)O(N)MediumPrefix Sum, Mono Stack
DCute Little ButterflyPyPy3 Python3O(NlogN)O(N)HardDP, Segment Tree, Coordinate Compression, Sorted List

Round H

#TitleSolutionTimeSpaceDifficultyTagNote
ARunning in CirclesPython3O(N)O(1)EasySimulation, Math
BMagical Well Of LiliesPython3O(MAX_L * log(MAX_L))O(MAX_L)MediumDP
CEelectricityPython3 Python3 Python3O(N)O(N)MediumTree DP, Topological Sort, BFS, DFS
DLevel DesignPyPy3O(N * sqrt(N))O(N)HardDP, Greedy, Mono Deque