name
string | year
string | round
string | statement
string | input
string | solution
string | code
string | output
string | sample_input
string | sample_output
string | images
sequence |
---|---|---|---|---|---|---|---|---|---|---|
meta_game | 2023 | round2 | "Hacker Cup contest strategy often involves a metagame, where choosing which problems to work on mig(...TRUNCATED) | "135\n6\n3 2 3 5 6 4\n4 6 5 3 2 3\n6\n3 3 2 3 5 6\n4 4 6 5 3 2\n6\n4 3 2 3 5 6\n3 4 6 5 3 2\n2\n1 1\(...TRUNCATED) | "Note that over time, a pair of dots that are next to each other will always stay next to each other(...TRUNCATED) | "#include <deque>\n#include <iostream>\n#include <vector>\nusing namespace std;\n\nint N;\ndeque<int(...TRUNCATED) | "Case #1: 0\nCase #2: 1\nCase #3: -1\nCase #4: -1\nCase #5: 6\nCase #6: -1\nCase #7: 7\nCase #8: 2\n(...TRUNCATED) | "8\n6\n3 2 3 5 6 4\n4 6 5 3 2 3\n6\n3 3 2 3 5 6\n4 4 6 5 3 2\n6\n4 3 2 3 5 6\n3 4 6 5 3 2\n2\n1 1\n1(...TRUNCATED) | "Case #1: 0\nCase #2: 1\nCase #3: -1\nCase #4: -1\nCase #5: 6\nCase #6: -1\nCase #7: 7\nCase #8: 2\n(...TRUNCATED) | ["iVBORw0KGgoAAAANSUhEUgAAA38AAAKOCAYAAAAWDqCHAAABXmlDQ1BJQ0MgUHJvZmlsZQAAKJFtkMtKw2AQhU+1UqgKAd0oIg(...TRUNCATED) |
tower_rush | 2023 | round2 | "Alice and Bob are playing *Tower Rush,* a two-phase game involving \\(N\\) types of blocks, numbere(...TRUNCATED) | "25\n5 3 3\n2 4 5 7 8\n3 2 4\n3 6 9\n10 2 3\n338 770 597 105 357 82 928 446 139 341\n10 5 7\n670359 (...TRUNCATED) | "First note that, for a set of blocks, it does not matter how they are distributed between the playe(...TRUNCATED) | "#include <cassert>\n#include <iostream>\n#include <vector>\nusing namespace std;\n\nconst int MAX =(...TRUNCATED) | "Case #1: 54\nCase #2: 0\nCase #3: 62\nCase #4: 29520\nCase #5: 5800\nCase #6: 859449537\nCase #7: 4(...TRUNCATED) | 2
5 3 3
2 4 5 7 8
3 2 4
3 6 9
| Case #1: 54
Case #2: 0
| [] |
ready_go_part_2 | 2023 | round2 | "_This problem shares some similarities with A1, with key differences in bold._\n\n_Atari 2600? More(...TRUNCATED) | "239\n4 4\n.B..\nBW..\n.B..\n....\n4 5\nWWWB.\nWB...\nWB.WB\nB.W..\n4 5\nWWWB.\nWB...\nWB.WB\n..W..\(...TRUNCATED) | "We can augment our solution to part 1 with a bit more information to solve part 2. Additionally, no(...TRUNCATED) | "#include <algorithm>\n#include <iostream>\n#include <map>\n#include <set>\n#include <vector>\n#incl(...TRUNCATED) | "Case #1: 1\nCase #2: 5\nCase #3: 0\nCase #4: 0\nCase #5: 1\nCase #6: 0\nCase #7: 8\nCase #8: 0\nCas(...TRUNCATED) | "4\n4 4\nW...\nB.BB\n.BWW\n.BW.\n5 5\nW...W\n.W.W.\nBBWBB\n.W.W.\nW...W\n5 5\nB..B.\nWBBWB\nW.WWB\nW(...TRUNCATED) | Case #1: 3
Case #2: 0
Case #3: 9
Case #4: 4
| ["iVBORw0KGgoAAAANSUhEUgAAAUQAAAFGCAYAAAASIubNAAAKrWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUE1kXgN9MekhoCRGQEm(...TRUNCATED) |
wiki_race | 2023 | round2 | "You and some friends are playing [Wiki Race](https://en.wikipedia.org/wiki/Wikipedia:Wiki\\_Game) o(...TRUNCATED) | "32\n6\n1 1 2 2 5\n4 mozzarella cheddar gouda edam\n5 gouda gjetost mozzarella cheddar edam\n3 gruye(...TRUNCATED) | "Let \\(L\\) be the number of leaves in the tree. A partition that optimally learns topics for all p(...TRUNCATED) | "#include <iostream>\n#include <unordered_map>\n#include <unordered_set>\n#include <vector>\nusing n(...TRUNCATED) | "Case #1: 3\nCase #2: 1\nCase #3: 3\nCase #4: 2\nCase #5: 1\nCase #6: 3\nCase #7: 5\nCase #8: 9\nCas(...TRUNCATED) | "3\n6\n1 1 2 2 5\n4 mozzarella cheddar gouda edam\n5 gouda gjetost mozzarella cheddar edam\n3 gruyer(...TRUNCATED) | Case #1: 3
Case #2: 1
Case #3: 3
| ["iVBORw0KGgoAAAANSUhEUgAAA5gAAAJ7CAYAAACGbz4lAAABXmlDQ1BJQ0MgUHJvZmlsZQAAKJFtkMtKw2AQhU+1UqgKAd0oIg(...TRUNCATED) |
ready_go_part_1 | 2023 | round2 | "_This problem shares some similarities with A2, with key differences in bold._\n\n_Atari 2600? More(...TRUNCATED) | "239\n4 4\n.B..\nBW..\n.B..\n....\n4 5\nWWWB.\nWB...\nWB.WB\nB.W..\n4 5\nWWWB.\nWB...\nWB.WB\n..W..\(...TRUNCATED) | "A group of white stones can be captured if and only if there's exactly \\(1\\) empty space adjacent(...TRUNCATED) | "#include <iostream>\n#include <set>\n#include <vector>\n#include <utility>\nusing namespace std;\n\(...TRUNCATED) | "Case #1: YES\nCase #2: YES\nCase #3: NO\nCase #4: NO\nCase #5: YES\nCase #6: NO\nCase #7: YES\nCase(...TRUNCATED) | "5\n4 4\n.B..\nBW..\n.B..\n....\n4 5\nWWWB.\nWB...\nWB.WB\nB.W..\n4 5\nWWWB.\nWB...\nWB.WB\n..W..\n3(...TRUNCATED) | Case #1: YES
Case #2: YES
Case #3: NO
Case #4: NO
Case #5: YES
| ["iVBORw0KGgoAAAANSUhEUgAAAUQAAAFGCAYAAAASIubNAAAKrWlDQ1BJQ0MgUHJvZmlsZQAASImVlwdUE1kXgN9MekhoCRGQEm(...TRUNCATED) |
dim_sum_delivery | 2023 | practice | "*Nim Sum Dim Sum*, a bustling local dumpling restaurant, has two game theory-loving servers named, (...TRUNCATED) | "600\n2 2 1 1\n2 3 1 1\n2 3 1 2\n2 4 1 1\n2 4 1 2\n2 4 1 3\n2 100 1 1\n2 100 1 2\n2 100 1 3\n2 100 1(...TRUNCATED) | "If Alice reaches row \\(R\\) before Bob reaches row \\(C\\), then it's game over for Alice. Since e(...TRUNCATED) | "#include <iostream>\nusing namespace std;\n\nint main() {\n int T;\n cin >> T;\n for (int t = 1;(...TRUNCATED) | "Case #1: NO\nCase #2: NO\nCase #3: NO\nCase #4: NO\nCase #5: NO\nCase #6: NO\nCase #7: NO\nCase #8:(...TRUNCATED) | 3
2 2 1 1
5 2 3 1
4 4 3 3
| Case #1: NO
Case #2: YES
Case #3: NO
| ["iVBORw0KGgoAAAANSUhEUgAAAuwAAACyCAYAAAAZO5pSAAAMPmlDQ1BJQ0MgUHJvZmlsZQAASImVVwdYU8kWnltSSWihSwm9CS(...TRUNCATED) |
cheeseburger_corollary_ch1 | 2023 | practice | "*This problem shares some similarities with A2, with key differences in bold.*\n\nProblem solving s(...TRUNCATED) | "79\n1 1 3\n0 2 4\n5 5 1\n0 1 1\n1 1 2\n97 1 99\n97 1 100\n100 100 1\n1 1 100\n73 11 11\n51 80 87\n9(...TRUNCATED) | "Each single provides \\(2\\) buns and \\(1\\) patty. Each double provides \\(2\\) buns and \\(2\\) (...TRUNCATED) | "#include <iostream>\nusing namespace std;\n\nint main() {\n int T;\n cin >> T;\n for (int t = 1;(...TRUNCATED) | "Case #1: YES\nCase #2: NO\nCase #3: YES\nCase #4: YES\nCase #5: YES\nCase #6: YES\nCase #7: NO\nCas(...TRUNCATED) | 7
1 1 3
0 2 4
5 5 1
0 1 1
1 1 2
97 1 99
97 1 100
| Case #1: YES
Case #2: NO
Case #3: YES
Case #4: YES
Case #5: YES
Case #6: YES
Case #7: NO
| ["iVBORw0KGgoAAAANSUhEUgAAB4AAAAP7CAYAAAC6CJPXAAAAAXNSR0IArs4c6QAAAKRlWElmTU0AKgAAAAgABgESAAMAAAABAA(...TRUNCATED) |
two_apples_a_day | 2023 | practice | "“An apple a day keeps the doctor away” is Steve’s motto. His other motto, “You can never ha(...TRUNCATED) | "90\n3\n6 3 1 2 5\n2\n7 7 7\n1\n1\n3\n1 9 1 1 4\n4\n1 9 1 1 4 9 9\n4\n1 9 10 1 4 6 9\n3\n1000000000 (...TRUNCATED) | "If there's only one element, we don't care what it is, a \\(1\\) will match it. \n\nOtherwise, let'(...TRUNCATED) | "#include <algorithm>\n#include <iostream>\n#include <vector>\nusing namespace std;\n\nconst int INF(...TRUNCATED) | "Case #1: 4\nCase #2: 7\nCase #3: 1\nCase #4: -1\nCase #5: 6\nCase #6: -1\nCase #7: 1000000002\nCase(...TRUNCATED) | "7\n3\n6 3 1 2 5\n2\n7 7 7\n1\n1\n3\n1 9 1 1 4\n4\n1 9 1 1 4 9 9\n4\n1 9 10 1 4 6 9\n3\n1000000000 2(...TRUNCATED) | Case #1: 4
Case #2: 7
Case #3: 1
Case #4: -1
Case #5: 6
Case #6: -1
Case #7: 1000000002
| ["iVBORw0KGgoAAAANSUhEUgAAB38AAAI0CAYAAAAdhuMWAAAAAXNSR0IArs4c6QAAAKRlWElmTU0AKgAAAAgABgESAAMAAAABAA(...TRUNCATED) |
cheeseburger_corollary_ch2 | 2023 | practice | "*This problem shares some similarities with A1, with key differences in bold.*\n\nProblem solving s(...TRUNCATED) | "80\n2 3 5\n2 3 2\n2 3 1\n5 1 100\n1 3 100\n1 1 1000000000000\n314 512 1024\n10 13 11234567890\n1000(...TRUNCATED) | "Let's think about what ingredient is limiting us. If we've bought \\(0\\) singles, we're limited by(...TRUNCATED) | "#include <algorithm>\n#include <iostream>\nusing namespace std;\n\nusing int64 = long long;\n\nint6(...TRUNCATED) | "Case #1: 3\nCase #2: 1\nCase #3: 0\nCase #4: 199\nCase #5: 100\nCase #6: 1999999999999\nCase #7: 3\(...TRUNCATED) | 6
2 3 5
2 3 2
2 3 1
5 1 100
1 3 100
1 1 1000000000000
| Case #1: 3
Case #2: 1
Case #3: 0
Case #4: 199
Case #5: 100
Case #6: 1999999999999
| ["iVBORw0KGgoAAAANSUhEUgAAB4AAAAP7CAYAAAC6CJPXAAAAAXNSR0IArs4c6QAAAKRlWElmTU0AKgAAAAgABgESAAMAAAABAA(...TRUNCATED) |
road_to_nutella | 2023 | practice | "You and your friends have drawn a really big connected graph in sidewalk chalk with \\(N\\) nodes ((...TRUNCATED) | "160\n13 15\n1 2\n2 3\n2 4\n4 5\n3 5\n5 6\n6 7\n6 8\n8 9\n8 12\n8 13\n9 10\n10 11\n11 12\n12 13\n5\n(...TRUNCATED) | "It's easier to think about this problem if instead of thinking about which foot we're standing on, (...TRUNCATED) | "#include <algorithm>\n#include <iostream>\n#include <queue>\n#include <set>\n#include <vector>\nusi(...TRUNCATED) | "Case #1: 5\nCase #2: -2\nCase #3: -2\nCase #4: 0\nCase #5: 270676\nCase #6: 121294\nCase #7: 305198(...TRUNCATED) | "4\n13 15\n1 2\n2 3\n2 4\n4 5\n3 5\n5 6\n6 7\n6 8\n8 9\n8 12\n8 13\n9 10\n10 11\n11 12\n12 13\n5\n7 (...TRUNCATED) | Case #1: 5
Case #2: -2
Case #3: 0
Case #4: -2
| ["iVBORw0KGgoAAAANSUhEUgAAB4AAAAQ4CAIAAABnsVYUAAAFYGlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IG(...TRUNCATED) |
Data Preview
The data available in this preview contains a 10 row dataset:
- Sample Dataset ("sample"): This is a subset of the full dataset, containing data from 2023.
To view full dataset, download output_dataset.parquet
. This contains data from 2011 to 2023.
Fields
The dataset include the following fields:
name
(string)year
(string)round
(string)statement
(string)input
(string)solution
(string)code
(string)sample_input
(string)sample_output
(string)images
(array of base64 image strings)
This dataset contains every Facebook/Meta Hacker Cup problem from 2011 through 2023. For each problem, you'll find these files:
<problem_name>.md
: The problem statement formatted in Markdown<problem_name>.in
: The full input file<problem_name>.out
: The full output file- Note that some problems accept multiple possible outputs, in which case the full output file is simply an example of an output that would be accepted
<problem_name>_sample_input.txt
: The sample input provided by the problem statement<problem_name>_sample_output.txt
: The sample output provided by the problem statement
Note that for problems from 2011 thorugh 2019, the problems were initially typeset in html. For those problems you can find:
<problem_name>.html
: The problem statement formatted in HTML
For these problems, the Markdown version of the statement (<problem_name>.md
) was automatically generated from the HTML version and may contain errors.
For some problems, written solutions/analyses are available:
<problem_name>.sol.md
** For some problem, code solutions are available:<problem_name>.(cpp|py|java)
Some problems contains references to images that look like this:
{{PHOTO_ID:<photo_id>}}
, example:{{PHOTO_ID:923060468192530}}
In the same folder as the problem statement, you can find <photo_id>.jpg
or <photo_id>.gif
Starter Kits
Some quick start solutions for working with this data are available at HackerCupAI Repo. Some frameworks include:
The samples show basic steps for data ingest, generating solutions, and evaluation. For an example of data ingest, check out this example
Notes
- Solutions prior to 2019 do not contain markdown solution files.
- The 2019 markdown solutions are not included in the dataset but can be found in
.cpp
files.
Citation
If you use this dataset, please cite it as follows:
@misc{2024hackercupai,
title = {2024 Hacker Cup Dataset},
author = {May, Wesley and Harmeyer, David and Hoak, Amber and Saroufim, Mark and Li, Margaret and Dymchenko, Sergii and Yang, Weiwei},
}
- Downloads last month
- 539