GoogleCodeJam 2019 [](./LICENSE)

April 5, 2020 · View on GitHub

Python solutions of Google Code Jam 2019. 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).

Qualification Round

#TitleSolutionTimeSpaceDifficultyTagNote
AForegone SolutionPythonO(logN)O(1)EasyMath
BYou Can Go Your Own WayPythonO(N)O(1)EasyString
CCryptopangramsPythonO(LlogN)O(1)MediumMath
DDat BaePython PythonO(NlogB)O(N)MediumBit Manipulation, BFS

Round 1A

#TitleSolutionTimeSpaceDifficultyTagNote
APylonsPythonO(R * C)O(1)MediumConstructive
BGolf GophersPython PythonO(B * N + BlogM)O(B)MediumChinese Remainder Theorem
CAlien RhymePythonO(T)O(T)EasyTrie

Round 1B

#TitleSolutionTimeSpaceDifficultyTagNote
AManhattan Crepe CartPythonO(PlogP)O(P)EasyLine Sweep
BDraupnirPythonO(1)O(1)MediumMath
CFair FightPython PyPyO(NlogN)O(N)HardMono Stack, Binary Search, RMQ

Round 1C

#TitleSolutionTimeSpaceDifficultyTagNote
ARobot Programming StrategyPythonO(A^2)O(A)EasyGreedy
BPower ArrangersPythonO(1)O(1)EasyMath
CBacterial TacticsPythonO(R^2 * C^2 * (R + C))O(R^2 * C^2)MediumSprague–Grundy Theorem

Round 2

#TitleSolutionTimeSpaceDifficultyTagNote
ANew Elements: Part 1PythonO(N^2 * log(max(C, J)))O(N^2 * log(max(C, J)))EasyMath
BPottery LotteryPython PythonO(PlogV)O(V)MediumMath, Greedy
CNew Elements: Part 2PythonO(N^2 * log(max(C, J)))O(log(max(C, J)))MediumMath, Continued Fraction
DContransmutationPythonO(M)O(M)HardGraph, Topological Sort, DP

Round 3

#TitleSolutionTimeSpaceDifficultyTagNote
AZillionimPython PythonO(R^2)O(R)EasySprague-Grundy Theorem, Nim
BPancake PyramidPythonO(S)O(S)MediumMono Stack
CDatacenter DuplexPythonO(R * C)O(R * C)MediumUnion Find
DNapkin FoldingPythonO(N^2 * K^2)O(N * K^2)Very Hard❤️Geometry, Sliding Window, Binary Search, BFS, DFS

World Finals

You can relive the magic of the 2019 Code Jam World Finals by watching the Live Stream Recording of the competition, problem explanations, interviews with Google and Code Jam engineers, and announcement of winners.

#TitleSolutionTimeSpaceDifficultyTagNote
ABoard MeetingPythonO(NlogM)O(N)MediumBinary Search, Math
BSorting Permutation UnitPythonO(K * N^2)O(N)MediumSort
CWon't sum? Must nowPythonO(2^(D/2) * D)O(D)Hard❤️Backtracking, Arithmetic, Palindrome
DJuggle Struggle: Part 1PyPyO(NlogN) on averageO(N)MediumGeometry, Recursion, Quick Select
EJuggle Struggle: Part 2PyPyO(NlogN)O(N)Hard❤️Geometry, Sort, Mono Stack, Convex Hull
FGo To Considered HelpfulC++ *PyPyO(N^4)O(N^2)MediumBFS, DP