Giter Site home page Giter Site logo

kamyu104 / facebookhackercup-2018 Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 6.0 234 KB

๐Ÿƒ Python Solutions of All 21 Problems in FHC 2018

Python 96.53% C++ 3.47%
hackercup facebook-hacker-cup algorithm algorithm-challenges puzzle-solution programming-contests contest-programming competitive-programming

facebookhackercup-2018's Introduction

Python solutions of Facebook Hacker Cup 2018. 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 6-minute timer is set for uploading the result this year.

Qualification Round

# Title Solution Time Space Difficulty Tag Note
1 Tourist Python O(K) O(1) Easy Math
2 Interception Python O(1) O(1) Easy Math
3 Ethan Searches for a String Python O(N) O(1) Easy String

Round 1

# Title Solution Time Space Difficulty Tag Note
1 Let It Flow Python O(N) O(W) Easy DP
2 Ethan Traverses a Tree Python O(N) O(N) Easy Graph
3 Platform Parkour Python O(N * (M + logZ)) O(N) Medium Intervals
4 Evening of the Living Dead Python O(N * M) O(N) Hard DP, Probability

Round 2

# Title Solution Time Space Difficulty Tag Note
1 Ethan Finds the Shortest Path Python O(N) O(1) Easy Graph, Greedy
2 Jack's Candy Shop Python O(N * (logN)^2) O(N) Medium Greedy, Heap, Stack, Recursion
3 Replay Value PyPy O(N^5) O(N^4) Hard DP
4 Fossil Fuels PyPy O(NlogN) O(N) Hard DP, Mono Deque, Segment Tree, RMQ

Round 3

# Title Solution Time Space Difficulty Tag Note
1 Jammin' Python O(N) O(1) Easy Simulation
2 Ethan Finds the Maximum Subarray Sum Python O(M^2 * K) O(1) Medium Greedy
3 Graph Gift PyPy O(N^2) O(N) Medium Greedy
4 Finshakes Python O(M^3) O(M^2) Hard DP

Final Round

You can relive the magic of the 2018 Hacker Cup World Finals by watching the Live Stream Recording of the announcement of winners.

# Title Solution Time Space Difficulty Tag Note
1 Contest Environment Python O(N) O(1) Easy Math
2 Stockholm Python O(logA + logB) O(logA + logB) Easy Binary Tree, Bit Manipulation, Greedy
3 Ethan Sums Shortest Distances Python
Python
Python
Python
O(N^3) O(N^2) Easy Prefix Sum, DP
4 Personal Space PyPy O(NlogN) O(N) Medium Skip List, Line Sweep, DP
5 City Lights PyPy PyPy O(S^2 * W^2) O(S * W * min(S, W)) Hard Skip List, Binary Search, Recursion, Prefix Sum, DP
6 The Claw Python O(NlogN) O(N) Medium Mono Stack, Binary Search, Segment Tree, DP

facebookhackercup-2018's People

Contributors

kamyu104 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

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.