Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🏃 Python Solutions of All 32 Problems in GKS 2020

License

NotificationsYou must be signed in to change notification settings

kamyu104/GoogleKickStart-2020

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 asVery Hard means that it was an unsolved one during the contest and may not be that difficult.

Round A

#TitleSolutionTimeSpaceDifficultyTagNote
AAllocationPythonO(N)O(MAX_A)EasyGreedy, Counting Sort
BPlatesPythonO(N * P * K)O(P)EasyDP, Prefix Sum
CWorkoutPythonO(Nlog(MAX_DIFF))O(1)EasyBinary Search, Greedy
DBundlingPythonO(N * L)O(T)MediumTrie, Greedy, DFS, Stack

Round B

#TitleSolutionTimeSpaceDifficultyTagNote
ABike TourPythonO(N)O(1)EasyArray
BBus RoutesPythonO(N)O(1)EasyGreedy
CRobot Path DecodingPythonO(N)O(N)EasyStack
DWandering RobotPythonPythonO(W + H)O(W + H)HardBinomial Coefficients, Probability, Log Representation, Prefix Sum

Round C

#TitleSolutionTimeSpaceDifficultyTagNote
ACountdownPythonO(N)O(1)EasyArray
BStable WallPythonO(R * C)O(1)EasyTopological Sort, DFS
CPerfect SubarrayPyPyO(N * sqrt(N * MAX_A))O(N * MAX_A)MediumMath, Prefix Sum
DCandiesPythonO(N + QlogN)O(N)MediumBIT, Fenwick Tree

Round D

#TitleSolutionTimeSpaceDifficultyTagNote
ARecord BreakerPythonO(N)O(1)EasyArray
BAlien PianoPythonO(K)O(1)EasyGreedy
CBeauty of TreePythonO(N)O(N)MediumDFS, Math
DLocked DoorsPyPyO(NlogN + QlogN)O(N)HardCartesian Tree, Binary Lifting

Round E

#TitleSolutionTimeSpaceDifficultyTagNote
ALongest ArithmeticPythonO(N)O(1)EasyArray
BHigh BuildingsPythonO(N)O(N)EasyConstructive Algorithms
CToysPythonO(NlogN)O(N)MediumGreedy, Heap
DGolden StonePythonPythonO((N * S + M * S + R * N) * log(N * S))O(N * S + M)HardDijkstra's Algorithm

Round F

#TitleSolutionTimeSpaceDifficultyTagNote
AATM QueuePythonO(NlogN)O(1)EasySort
BMetal HarvestPythonO(NlogN)O(1)EasySort
CPainters' DuelPythonO(2^(S^2))O(2^(S^2))MediumMemoization, Alpha Beta Pruning
DYeetzheePythonO(M * S)O(M * S)HardMath, Expected Value, Memoization, Greedy

Round G

#TitleSolutionTimeSpaceDifficultyTagNote
AKick_StartPythonO(N)O(1)EasyMath
BMaximum CoinsPythonPythonO(N^2)O(1)EasyMatrix
CCombination LockPythonPythonO(WlogW)O(1)EasyMath, Median, Prefix Sum
DMerge CardsPythonPythonO(N)O(N)MediumMath, Expected Value, DP, Precompute, Prefix Sum

Round H

#TitleSolutionTimeSpaceDifficultyTagNote
ARetypePythonO(1)O(1)EasyMath
BBoring NumbersPythonO(logR)O(1)EasyMath
CRugbyPythonO(NlogN)O(N)MediumMath, Median
DFriendsPyPyPyPyO(A^3 + L^2 * (N + Q))O(A^2)MediumFloyd-Warshall Algorithm

[8]ページ先頭

©2009-2025 Movatter.jp