{"id":29164085,"url":"https://github.com/kamyu104/googlecodejam-2014","last_synced_at":"2025-07-01T06:39:55.503Z","repository":{"id":34914139,"uuid":"38961304","full_name":"kamyu104/GoogleCodeJam-2014","owner":"kamyu104","description":"🏃 Python Solutions of All 27 Problems of GCJ 2014","archived":false,"fork":false,"pushed_at":"2021-10-20T15:42:22.000Z","size":158,"stargazers_count":13,"open_issues_count":0,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-12T00:58:50.556Z","etag":null,"topics":["algorithm","codejam","competitive-programming","contest-programming","gcj","google-code-jam","googlecodejam","programming-contests","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kamyu104.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-12T12:32:39.000Z","updated_at":"2023-05-22T13:24:00.000Z","dependencies_parsed_at":"2022-09-01T00:52:43.141Z","dependency_job_id":null,"html_url":"https://github.com/kamyu104/GoogleCodeJam-2014","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kamyu104/GoogleCodeJam-2014","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2014","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2014/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2014/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2014/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamyu104","download_url":"https://codeload.github.com/kamyu104/GoogleCodeJam-2014/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2014/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262915662,"owners_count":23383847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","codejam","competitive-programming","contest-programming","gcj","google-code-jam","googlecodejam","programming-contests","python"],"created_at":"2025-07-01T06:39:45.142Z","updated_at":"2025-07-01T06:39:55.450Z","avatar_url":"https://github.com/kamyu104.png","language":"Python","readme":"# [GoogleCodeJam 2014](https://codingcompetitions.withgoogle.com/codejam/archive/2014) ![Language](https://img.shields.io/badge/language-Python-orange.svg) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.md) ![Progress](https://img.shields.io/badge/progress-27%20%2F%2027-ff69b4.svg)\n\nPython solutions of Google Code Jam 2014. Solution begins with `*` means it will get TLE in the largest data set (total computation amount \u003e `10^8`, which is not friendly for Python to solve in 5 ~ 15 seconds). A `4-minute` timer is set for the small dataset and a `8-minute` timer is set for the large dataset this year.\n\n* [Code Jam 2013](https://github.com/kamyu104/GoogleCodeJam-2013)\n* [Qualification Round](https://github.com/kamyu104/GoogleCodeJam-2014#qualification-round)\n* [Round 1A](https://github.com/kamyu104/GoogleCodeJam-2014#round-1a)\n* [Round 1B](https://github.com/kamyu104/GoogleCodeJam-2014#round-1b)\n* [Round 1C](https://github.com/kamyu104/GoogleCodeJam-2014#round-1c)\n* [Round 2](https://github.com/kamyu104/GoogleCodeJam-2014#round-2)\n* [Round 3](https://github.com/kamyu104/GoogleCodeJam-2014#round-3)\n* [World Finals](https://github.com/kamyu104/GoogleCodeJam-2014#world-finals)\n* [Code Jam 2015](https://github.com/kamyu104/GoogleCodeJam-2015)\n\n## Qualification Round\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Magic Trick](https://code.google.com/codejam/contest/2974486/dashboard#s=p0)| [Python](./Qualification%20Round/magic_trick.py) | _O(1)_  | _O(1)_  | Easy | | Set |\n|B| [Cookie Clicker Alpha](https://code.google.com/codejam/contest/2974486/dashboard#s=p1)| [Python](./Qualification%20Round/cookie_clicker_alpha.py) | _O(X / C)_  | _O(1)_  | Easy | | Math |\n|C| [Minesweeper Master](https://code.google.com/codejam/contest/2974486/dashboard#s=p2)| [Python](./Qualification%20Round/minesweeper_master.py) | _O(R * C)_  | _O(1)_ | Medium | | Enumeration |\n|D| [Deceitful War](https://code.google.com/codejam/contest/2974486/dashboard#s=p3)| [Python](./Qualification%20Round/deceitful_war.py) | _O(NlogN)_  | _O(N)_ | Medium | | Sort |\n\n## Round 1A\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Charging Chaos](https://code.google.com/codejam/contest/2984486/dashboard#s=p0)| [Python](./Round%201A/charging_chaos.py) | _O(N^2)_  | _O(N)_  | Easy | | Bit Manipulation |\n|B| [Full Binary Tree](https://code.google.com/codejam/contest/2984486/dashboard#s=p1)| [Python](./Round%201A/full_binary_tree.py)  | _O(N)_ |  _O(N)_ | Easy | | DFS, Graph, Binary Tree |\n|C| [Proper Shuffle](https://code.google.com/codejam/contest/2984486/dashboard#s=p2)| [Python](./Round%201A/proper_shuffle.py) | precompute: _O(N^2)_\u003cbr\u003eclassify: _O(N)_ |  _O(N^2)_ | Medium | | Precomputation, Probability, Naive Bayes Classifier |\n\n## Round 1B\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [The Repeater](https://code.google.com/codejam/contest/2994486/dashboard#s=p0)| [Python](./Round%201B/the-repeater.py)| _O(X * N)_ | _O(X * N)_ | Easy | | Math |\n|B| [New Lottery Game](https://code.google.com/codejam/contest/2994486/dashboard#s=p1)| [Python](./Round%201B/new-lottery-game.py)| _O(log(max(A, B)))_ | _O(log(max(A, B)))_ | Medium | | Math, DP, Memoization |\n|C| [The Bored Traveling Salesman](https://code.google.com/codejam/contest/2994486/dashboard#s=p2)| [Python](./Round%201B/the-bored-traveling-salesman.py)| _O(N^3)_ | _O(M + N)_ | Hard | | Greedy |\n\n## Round 1C\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Part Elf](https://code.google.com/codejam/contest/3004486/dashboard#s=p0)| [Python](./Round%201C/part-elf.py)| _O(logQ)_ | _O(1)_ | Easy | | Math |\n|B| [Reordering Train Cars](https://code.google.com/codejam/contest/3004486/dashboard#s=p1)| [Python](./Round%201C/reordering-train-cars.py)| _O(L)_ | _O(1)_ | Medium | | Math |\n|C| [Enclosure](https://code.google.com/codejam/contest/3004486/dashboard#s=p2)| [Python](./Round%201C/enclosure.py)| _O(N^2 * M)_ | _O(1)_ | Hard | | Greedy, Math |\n\n## Round 2\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Data Packing](https://codingcompetitions.withgoogle.com/codejam/round/0000000000432fed/0000000000432b8d)| [Python](./Round%202/data_packing.py) [Python](./Round%202/data_packing2.py) | _O(N)_ | _O(1)_ | Easy | | Counting Sort, Greedy, Two Pointers |\n|B| [Up and Down](https://codingcompetitions.withgoogle.com/codejam/round/0000000000432fed/000000000043333d)| [Python](./Round%202/up_and_down.py) | _O(NlogN)_ | _O(N)_ | Easy | | Greedy, BIT, Fenwick Tree |\n|C| [Don't Break The Nile](https://codingcompetitions.withgoogle.com/codejam/round/0000000000432fed/0000000000433109)| [Python](./Round%202/dont_break_the_nile.py) | _O(B^2)_ | _O(B)_ | Medium | | Greedy, Minimum Cut, Dijkstra's Algorithm |\n|D| [Trie Sharding](https://codingcompetitions.withgoogle.com/codejam/round/0000000000432fed/0000000000432f41)| [Python](./Round%202/trie_sharding.py) | _O(M * L + T * N^2)_ | _O(T)_ | Hard | | Trie, Greedy, Combinatorics, Counting, DP |\n\n## Round 3\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Magical, Marvelous Tour](https://codingcompetitions.withgoogle.com/codejam/round/000000000043371f/000000000043380e)| [Python](./Round%203/magical_marvelous_tour.py) | _O(N)_ | _O(N)_ | Easy | | Two Pointers |\n|B| [Last Hit](https://codingcompetitions.withgoogle.com/codejam/round/000000000043371f/0000000000433a3e)| [Python](./Round%203/last_hit.py) | _O(N^2 * MAX_H/Q)_ | _O(N * MAX_H/Q)_ | Medium | | DP |\n|C| [Crime House](https://codingcompetitions.withgoogle.com/codejam/round/000000000043371f/00000000004331cb)| [Python](./Round%203/crime_house.py) | _O(N^2 * logN)_ | _O(N)_ | Hard | | Greedy, Binary Search |\n|D| [Willow](https://codingcompetitions.withgoogle.com/codejam/round/000000000043371f/00000000004336d0)| [Python](./Round%203/willow.py) | _O(N^2)_ | _O(N^2)_ | Very Hard | | Game, Tree, Minimax, Memoization, Precompute, DP |\n\n## World Finals\nYou can relive the magic of the 2014 Code Jam World Finals by watching the [Live Stream Recording](https://www.youtube.com/watch?v=GYX3sn3Q_DQ) of the competition, problem explanations, interviews with Google and Code Jam engineers, and announcement of winners.\n\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Checkboard Matrix](https://code.google.com/codejam/contest/7214486/dashboard#s=p0)| [Python](./World%20Finals/checkboard-matrix.py)| _O(N^2)_ | _O(N^2)_ | Medium | | |\n|B| [Power Swapper](https://code.google.com/codejam/contest/7214486/dashboard#s=p1)| [Python](./World%20Finals/power-swapper.py)| _O(2^(N*2))_ | _O(2^N)_ | Medium | | Recursion |\n|C| [Symmetric Trees](https://code.google.com/codejam/contest/7214486/dashboard#s=p2)| [Python](./World%20Finals/symmetric-trees.py)| _O(N^3 * logN)_ | _O(N^2)_ | Hard | | Recursion |\n|D| [Paradox Sort](https://code.google.com/codejam/contest/7214486/dashboard#s=p3)| [Python](./World%20Finals/paradox-sort.py)| _O(N^2 * N!)_ | _O(N)_ | Hard | | DFS |\n|E| [Allergy Testing](https://code.google.com/codejam/contest/7214486/dashboard#s=p4)| [Python](./World%20Finals/allergy-testing.py) [Python](./World%20Finals/allergy-testing2.py) | _O((logN)^3)_ | _O(1)_ | Hard | | Binary Search |\n|F| [ARAM](https://code.google.com/codejam/contest/7214486/dashboard#s=p5)| [Python](./World%20Finals/aram.py)| _O(60 * N * R * G)_ | _O(1)_ | Very Hard | | Binary Search |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamyu104%2Fgooglecodejam-2014","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamyu104%2Fgooglecodejam-2014","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamyu104%2Fgooglecodejam-2014/lists"}