{"id":29164052,"url":"https://github.com/kamyu104/googlecodejam-2022","last_synced_at":"2025-07-01T06:39:51.880Z","repository":{"id":54481552,"uuid":"477227276","full_name":"kamyu104/GoogleCodeJam-2022","owner":"kamyu104","description":"🏃 Python3 Solutions of All 27 Problems in GCJ 2022","archived":false,"fork":false,"pushed_at":"2023-04-16T18:34:49.000Z","size":170,"stargazers_count":17,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-12T00:58:50.818Z","etag":null,"topics":["algorithm","code-jam","codejam","codejam-problems","codejam2022","competitive-programming","contest-programming","gcj","google-code-jam","python3"],"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","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-04-03T03:22:40.000Z","updated_at":"2023-11-02T06:21:24.000Z","dependencies_parsed_at":"2022-08-13T17:20:15.617Z","dependency_job_id":null,"html_url":"https://github.com/kamyu104/GoogleCodeJam-2022","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kamyu104/GoogleCodeJam-2022","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2022","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2022/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2022/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2022/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kamyu104","download_url":"https://codeload.github.com/kamyu104/GoogleCodeJam-2022/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kamyu104%2FGoogleCodeJam-2022/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","code-jam","codejam","codejam-problems","codejam2022","competitive-programming","contest-programming","gcj","google-code-jam","python3"],"created_at":"2025-07-01T06:39:41.896Z","updated_at":"2025-07-01T06:39:51.854Z","avatar_url":"https://github.com/kamyu104.png","language":"Python","readme":"# [GoogleCodeJam 2022](https://codingcompetitions.withgoogle.com/codejam/archive/2022) ![Language](https://img.shields.io/badge/language-Python3-orange.svg) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) ![Progress](https://img.shields.io/badge/progress-27%20%2F%2027-ff69b4.svg) ![Visitors](https://visitor-badge.laobi.icu/badge?page_id=kamyu104.googlecodejam.2022)\n\n* Python3 solutions of Google Code Jam 2022. Solution begins with `*` means it will get TLE in the largest data set.\n* Total computation amount \u003e `10^8` is not friendly for Python3 to solve in 5 ~ 15 seconds.\n* A problem was marked as `Very Hard` means that it was an unsolved one during the contest and may not be that difficult.\n\n## Rounds\n\n* [Code Jam 2021](https://github.com/kamyu104/GoogleCodeJam-2021)\n* [Qualification Round](https://github.com/kamyu104/GoogleCodeJam-2022#qualification-round)\n* [Round 1A](https://github.com/kamyu104/GoogleCodeJam-2022#round-1a)\n* [Round 1B](https://github.com/kamyu104/GoogleCodeJam-2022#round-1b)\n* [Round 1C](https://github.com/kamyu104/GoogleCodeJam-2022#round-1c)\n* [Round 2](https://github.com/kamyu104/GoogleCodeJam-2022#round-2)\n* [Round 3](https://github.com/kamyu104/GoogleCodeJam-2022#round-3)\n* [Virtual World Finals](https://github.com/kamyu104/GoogleCodeJam-2022#virtual-world-finals)\n* [Code Jam Farewell Rounds](https://github.com/kamyu104/GoogleCodeJam-Farewell-Rounds)\n\n## Qualification Round\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Punched Cards](https://codingcompetitions.withgoogle.com/codejam/round/0000000000876ff1/0000000000a4621b)| [Python3](./Qualification%20Round/punched_cards.py3)| _O(R * C)_ | _O(1)_ | Easy | | Array |\n|B| [3D Printing](https://codingcompetitions.withgoogle.com/codejam/round/0000000000876ff1/0000000000a4672b)| [Python3](./Qualification%20Round/three_d_printing.py3)| _O(1)_ | _O(1)_ | Easy | | Math |\n|C| [d1000000](https://codingcompetitions.withgoogle.com/codejam/round/0000000000876ff1/0000000000a46471)| [PyPy3](./Qualification%20Round/d1000000.py3) [Python3](./Qualification%20Round/d1000000-2.py3)| _O(NlogN)_ | _O(1)_ | Easy | | Sort |\n|D| [Chain Reactions](https://codingcompetitions.withgoogle.com/codejam/round/0000000000876ff1/0000000000a45ef7)| [Python3](./Qualification%20Round/chain_reactions.py3) [Python3](./Qualification%20Round/chain_reactions2.py3) |  _O(N)_ | _O(N)_ | Medium | | Topological Sort, Greedy |\n|E| [Twisty Little Passages](https://codingcompetitions.withgoogle.com/codejam/round/0000000000876ff1/0000000000a45fc0)| [Python3](./Qualification%20Round/twisty_little_passages.py3) [Python3](./Qualification%20Round/twisty_little_passages2.py3) |  _O(min(K, N))_ | _O(min(K, N))_ | Hard | | Probability, Importance Sampling |\n\n## Round 1A\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Double or One Thing](https://codingcompetitions.withgoogle.com/codejam/round/0000000000877ba5/0000000000aa8e9c)| [Python3](./Round%201A/double_or_one_thing.py3)| _O(\\|S\\|)_ | _O(1)_ | Easy | | String |\n|B| [Equal Sum](https://codingcompetitions.withgoogle.com/codejam/round/0000000000877ba5/0000000000aa8fc1)| [Python3](./Round%201A/equal_sum.py3) [Python3](./Round%201A/equal_sum2.py3) | _O(N)_ | _O(1)_ | Medium | | Math, Constructive Algorithms |\n|C| [Weightlifting](https://codingcompetitions.withgoogle.com/codejam/round/0000000000877ba5/0000000000aa9280)| [Python3](./Round%201A/weightlifting.py3)| _O(E^2 * W + E^3)_ | _O(E^2 + W)_ | Hard | | DP |\n\n## Round 1B\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Pancake Deque](https://codingcompetitions.withgoogle.com/codejam/round/000000000087711b/0000000000acd59d)| [Python3](./Round%201B/pancake_deque.py3)| _O(N)_ | _O(1)_ | Easy | | Greedy |\n|B| [Controlled Inflation](https://codingcompetitions.withgoogle.com/codejam/round/000000000087711b/0000000000accfdb)| [Python3](./Round%201B/controlled_inflation.py3) | _O(N * P)_ | _O(1)_ | Medium | | DP |\n|C| [ASeDatAb](https://codingcompetitions.withgoogle.com/codejam/round/000000000087711b/0000000000acd29b)| [Python3](./Round%201B/asedatab.py3) [Python3](./Round%201B/asedatab2.py3) [Python3](./Round%201B/asedatab3.py3) | _O(L * 2^L)_ | _O(L)_ | Hard | | Precompute, BFS, Topological Sort, Constructive Algorithms \n\n## Round 1C\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Letter Blocks](https://codingcompetitions.withgoogle.com/codejam/round/0000000000877b42/0000000000afe6a1)| [Python3](./Round%201C/letter_blocks.py3)| _O(N * L)_ | _O(N)_ | Easy | | String |\n|B| [Squary](https://codingcompetitions.withgoogle.com/codejam/round/0000000000877b42/0000000000afdf76)| [Python3](./Round%201C/squary.py3) | _O(N)_ | _O(1)_ | Medium | | Math, Constructive Algorithms |\n|C| [Intranets](https://codingcompetitions.withgoogle.com/codejam/round/0000000000877b42/0000000000afeb38)| [Python3](./Round%201C/intranets.py3) [Python3](./Round%201C/intranets2.py3) | precompute: _O(MAX_M)_\u003cbr\u003eruntime: _O(1)_ | _O(MAX_M)_ | Hard | |  Inclusion‐Exclusion Principle, Combinatorics, Catalan Number |\n\n## Round 2\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Spiraling Into Control](https://codingcompetitions.withgoogle.com/codejam/round/00000000008778ec/0000000000b15a74)| [Python3](./Round%202/spiraling_into_control.py3)| _O(N)_ | _O(1)_ | Easy | | Constructive Algorithms, Greedy, Math |\n|B| [Pixelated Circle](https://codingcompetitions.withgoogle.com/codejam/round/00000000008778ec/0000000000b158f7)| [Python3](./Round%202/pixelated_circle.py3) | _O(R)_ | _O(1)_ | Medium | | Math |\n|C| [Saving the Jelly](https://codingcompetitions.withgoogle.com/codejam/round/00000000008778ec/0000000000b158f8)| [PyPy3](./Round%202/saving_the_jelly.py3)| _O(N^2 * sqrt(N))_ | _O(N^2)_ | Medium | | Bipartite Matching, Hopcroft-Karp Algorithm |\n|D| [I, O Bot](https://codingcompetitions.withgoogle.com/codejam/round/00000000008778ec/0000000000b15167)| [Python3](./Round%202/io_bot.py3)| _O(NlogN)_ | _O(N)_ | Hard | | DP, Prefix Sum, Hash Table |\n\n## Round 3\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Revenge of GoroSort](https://codingcompetitions.withgoogle.com/codejam/round/00000000008779b4/0000000000b45189)| [Python3](./Round%203/revenge_of_gorosort.py3)| _O(C * N)_ | _O(N)_ | Easy | | Math, Expected Value, Trial and Error |\n|B| [Duck, Duck, Geese](https://codingcompetitions.withgoogle.com/codejam/round/00000000008779b4/0000000000b45244)| [PyPy3](./Round%203/duck_duck_geese.py3) [C++](./Round%203/duck_duck_geese.cpp) | _O(NlogN)_ | _O(N)_ | Medium | | Segment Tree |\n|C| [Mascot Maze](https://codingcompetitions.withgoogle.com/codejam/round/00000000008779b4/0000000000b44a4f)| [Python3](./Round%203/mascot_maze.py3)| _O(N)_ | _O(N)_ | Medium | | Topological Sort, Greedy |\n|D| [Win As Second](https://codingcompetitions.withgoogle.com/codejam/round/00000000008779b4/0000000000b4518a)| [Python3](./Round%203/win_as_second.py3) [Python3](./Round%203/win_as_second2.py3) [Python3](./Round%203/win_as_second3.py3) [PyPy3](./Round%203/win_as_second4.py3) | precompute: O(N^5) on average\u003cbr\u003eruntime: _O(N^3 + M * N^2)_ | _O(N^2)_ | Hard | | Bitmasks, Submask Enumeration, Sprague-Grundy Theorem, BFS, Constructive Algorithms, Precompute, Trial and Error |\n\n## Virtual World Finals\nYou can relive the magic of the 2022 Code Jam Virtual World Finals by watching the [Live Stream Recording](https://codingcompetitionsonair.withgoogle.com/events/codejam22/watch?talk=cj22-ls) of the competition, problem explanations, and announcement of winners.\n\n| # | Title | Solution | Time | Space | Difficulty | Tag | Note |\n|---| ----- | -------- | ---- | ----- | ---------- | --- | ---- |\n|A| [Wonderland Chase](https://codingcompetitions.withgoogle.com/codejam/round/000000000087762e/0000000000b9c499)| [Python3](./Virtual%20World%20Finals/wonderland_chase.py3) | _O(J + C)_ | _O(J + C)_ | Easy | | Graph, BFS\n|B| [Goose, Goose, Ducks?](https://codingcompetitions.withgoogle.com/codejam/round/000000000087762e/0000000000b9ce14)| [*PyPy3](./Virtual%20World%20Finals/goose_goose_ducks.py3) [C++](./Virtual%20World%20Finals/goose_goose_ducks.cpp) | _O(N + M + S * (logM + logS))_ | _O(N + S)_ | Hard | | Logic-Based, Sorted List, Graph, BFS, SCC, Tarjan's Algorithm\n|C| [Slide Parade](https://codingcompetitions.withgoogle.com/codejam/round/000000000087762e/0000000000b9cb13)| [PyPy3](./Virtual%20World%20Finals/slide_parade.py3) | _O(B * S + S^2)_ | _O(B * S)_ | Medium | | BFS, Constructive Algorithms, Bipartite Matching, Hungarian Algorithm, Eulerian Path, Hierholzer's Algorithm\n|D| [Schrödinger and Pavlov](https://codingcompetitions.withgoogle.com/codejam/round/000000000087762e/0000000000b9c73a)| [PyPy3](./Virtual%20World%20Finals/schrodinger_and_pavlov.py3) | _O(N)_ | _O(N)_ | Hard | ❤️ | Graph, Probability, DP\n|E| [Triangles](https://codingcompetitions.withgoogle.com/codejam/round/000000000087762e/0000000000b9c555)| [PyPy3](./Virtual%20World%20Finals/triangles.py3) [C++](./Virtual%20World%20Finals/triangles.cpp)  | _O(N^2)_ | _O(N)_ | Very Hard | ❤️ | Geometry, Constructive Algorithms, Greedy\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamyu104%2Fgooglecodejam-2022","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkamyu104%2Fgooglecodejam-2022","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkamyu104%2Fgooglecodejam-2022/lists"}