Binary Files: Each bracket is represented in binary format, packed into 9 bytes.
Brackets per File: Up to 100 million brackets per file.
Total Brackets: Up to 10¹⁴ brackets can be submitted.
Code Example: Generating Brackets and Writing to Files
Below is an example of how to generate brackets, pack them into the specified binary format, and write them to files.
import os
def pack_bracket(bits):
assert len(bits) == 67, "Bracket must have exactly 67 bits"
bytes_out = bytearray(9)
bit_index = 0
for byte_index in range(9):
byte = 0
for bit_position in range(8):
if bit_index < 67:
bit = bits[bit_index]
byte = (byte << 1) | bit
bit_index += 1
else:
byte = (byte << 1) # Pad with zero for unused bits
bytes_out[byte_index] = byte
return bytes_out
# Example brackets
# Bracket 1: All favorites win
bracket_all_favorites = [1] * 67
# Bracket 2: Some upsets
# Let's assume upsets in bits 4 (first round game), 20 (second round game), and 66 (championship game)
bracket_some_upsets = [1] * 67
bracket_some_upsets[4] = 0 # Lower seed wins in game corresponding to bit 4
bracket_some_upsets[20] = 0 # Lower seed wins in game corresponding to bit 20
bracket_some_upsets[66] = 0 # Team from latter region wins championship game
def write_brackets_to_file(bracket_list, filename):
with open(filename, 'wb') as file:
for bits in bracket_list:
packed_bracket = pack_bracket(bits)
file.write(packed_bracket)
# Write example brackets to two files
bracket_list_file1 = [bracket_all_favorites, bracket_some_upsets]
bracket_list_file2 = [bracket_some_upsets, bracket_all_favorites]
write_brackets_to_file(bracket_list_file1, 'brackets_file1.bin')
write_brackets_to_file(bracket_list_file2, 'brackets_file2.bin')
2. Compute Hashes of Your Files
Use SHA-256 to compute the hash of each bracket file. The hashes will be submitted before the tournament.
Code Example: Computing Hashes and Generating the Hash Submission File
import hashlib
def compute_file_hash(filename):
sha256_hash = hashlib.sha256()
with open(filename, 'rb') as file:
for block in iter(lambda: file.read(4096), b''):
sha256_hash.update(block)
return sha256_hash.hexdigest()
def generate_hashes_for_files(file_list, output_hash_file):
with open(output_hash_file, 'w') as hash_file:
for filename in file_list:
file_hash = compute_file_hash(filename)
hash_file.write(file_hash + '\n')
# Generate hashes for the two example files
file_list = ['brackets_file1.bin', 'brackets_file2.bin']
generate_hashes_for_files(file_list, 'hashes.txt')
3. Submit Hashes Before the Tournament
Hash Submission File:
Contains one hash per line, corresponding to your bracket files.
The order of hashes determines the order of your bracket files for tie-breaker purposes.
Upload Hashes:
Submit your hashes.txt file via the competition website before the tournament deadline.
4. Post-Tournament Verification
If you believe your brackets include the perfect bracket:
Make Your Winning Bracket File Available Online:
Upload the bracket file that contains the perfect bracket to a publicly accessible URL.
Submit the URL and Hash via the Competition Website:
Log in to your account on the competition website.
Navigate to the Verify Winning Bracket page.
Enter the URL where your bracket file is hosted.
Enter the SHA-256 hash of your bracket file.
Hosting and Submitting Your Winning Bracket File
Suppose your bracket file is brackets_file1.bin, and it contains the perfect bracket.
Compute the Hash of the Winning Bracket File:
Host the File Online:
Upload brackets_file1.bin to a web server or a file hosting service that provides a direct download link.
Submit via the Website:
Go to the Verify Winning Bracket page on the competition website.
Enter the URL and the hash of your bracket file.
Submit the form.
The competition organizers will then:
Verify that the provided hash exists in your submitted hashes.txt file.
Download the bracket file from the URL.
Verify that the hash matches the provided hash.
Check if the perfect bracket is present in the file.
Determine the winner based on the tie-breaker rules.
File Format Details
Bracket Representation
Bracket Size: Each bracket is 67 bits long.
Binary Encoding: Brackets are packed into 9 bytes.
Bit-to-Game Mapping
General Rules
Note that a higher seed here means a team with a lower seed number. For example, a 1 seed has a higher seed than a 2 seed.
Bits 0–1: At-Large Play-In Games
Assignment:
If the at-large play-in games feed into different regions:
Use the predefined Region Order to determine which game is assigned to which bit.
Region Order: East (first), Midwest (second), South (third), West (fourth).
Assign the game feeding into the earliest region in the Region Order to Bit 0 and the other to Bit 1.
If both at-large play-in games feed into the same region:
Assign Bit 0 to the game involving the higher-seeded teams.
Assign Bit 1 to the game involving the lower-seeded teams.
Bit Value:
1: The team whose name comes first alphabetically (from our provided list) wins.
0: The team whose name comes second alphabetically wins.
Bits 2–3: Automatic Qualifier Play-In Games
Assignment:
If the automatic qualifier play-in games feed into different regions:
Use the Region Order to assign bits similarly to the at-large games.
If both automatic qualifier play-in games feed into the same region:
Assign Bit 2 to the game involving the higher-seeded teams.
Assign Bit 3 to the game involving the lower-seeded teams.
Bit Value:
1: The team whose name comes first alphabetically wins.
0: The team whose name comes second alphabetically wins.
Detailed Bit Mapping
Bits 4–35: First Round (Round of 64)
There are 32 games in the First Round, 8 games per region.
Bits 4–11: East Region First Round Games
Bit 4: Game 1: Seed 1 vs Seed 16
Bit 5: Game 2: Seed 8 vs Seed 9
Bit 6: Game 3: Seed 5 vs Seed 12
Bit 7: Game 4: Seed 4 vs Seed 13
Bit 8: Game 5: Seed 6 vs Seed 11
Bit 9: Game 6: Seed 3 vs Seed 14
Bit 10: Game 7: Seed 7 vs Seed 10
Bit 11: Game 8: Seed 2 vs Seed 15
Bits 12–19: Midwest Region First Round Games
Bit 12: Game 1: Seed 1 vs Seed 16
Bit 13: Game 2: Seed 8 vs Seed 9
Bit 14: Game 3: Seed 5 vs Seed 12
Bit 15: Game 4: Seed 4 vs Seed 13
Bit 16: Game 5: Seed 6 vs Seed 11
Bit 17: Game 6: Seed 3 vs Seed 14
Bit 18: Game 7: Seed 7 vs Seed 10
Bit 19: Game 8: Seed 2 vs Seed 15
Bits 20–27: South Region First Round Games
Bit 20: Game 1: Seed 1 vs Seed 16
Bit 21: Game 2: Seed 8 vs Seed 9
Bit 22: Game 3: Seed 5 vs Seed 12
Bit 23: Game 4: Seed 4 vs Seed 13
Bit 24: Game 5: Seed 6 vs Seed 11
Bit 25: Game 6: Seed 3 vs Seed 14
Bit 26: Game 7: Seed 7 vs Seed 10
Bit 27: Game 8: Seed 2 vs Seed 15
Bits 28–35: West Region First Round Games
Bit 28: Game 1: Seed 1 vs Seed 16
Bit 29: Game 2: Seed 8 vs Seed 9
Bit 30: Game 3: Seed 5 vs Seed 12
Bit 31: Game 4: Seed 4 vs Seed 13
Bit 32: Game 5: Seed 6 vs Seed 11
Bit 33: Game 6: Seed 3 vs Seed 14
Bit 34: Game 7: Seed 7 vs Seed 10
Bit 35: Game 8: Seed 2 vs Seed 15
Bit Value for First Round Games (Bits 4–35):
1: Higher-seeded team wins.
0: Lower-seeded team wins.
Bits 36–51: Second Round (Round of 32)
There are 16 games in the Second Round, 4 games per region.
Bits 36–39: East Region Second Round Games
Bit 36: Game 9: Winner of Game 1 vs Winner of Game 2
Bit 37: Game 10: Winner of Game 3 vs Winner of Game 4
Bit 38: Game 11: Winner of Game 5 vs Winner of Game 6
Bit 39: Game 12: Winner of Game 7 vs Winner of Game 8
Bits 40–43: Midwest Region Second Round Games
Bit 40: Game 9: Winner of Game 1 vs Winner of Game 2
Bit 41: Game 10: Winner of Game 3 vs Winner of Game 4
Bit 42: Game 11: Winner of Game 5 vs Winner of Game 6
Bit 43: Game 12: Winner of Game 7 vs Winner of Game 8
Bits 44–47: South Region Second Round Games
Bit 44: Game 9: Winner of Game 1 vs Winner of Game 2
Bit 45: Game 10: Winner of Game 3 vs Winner of Game 4
Bit 46: Game 11: Winner of Game 5 vs Winner of Game 6
Bit 47: Game 12: Winner of Game 7 vs Winner of Game 8
Bits 48–51: West Region Second Round Games
Bit 48: Game 9: Winner of Game 1 vs Winner of Game 2
Bit 49: Game 10: Winner of Game 3 vs Winner of Game 4
Bit 50: Game 11: Winner of Game 5 vs Winner of Game 6
Bit 51: Game 12: Winner of Game 7 vs Winner of Game 8
Bit Value for Second Round Games (Bits 36–51):
1: Higher-seeded team (original seed from the tournament bracket) wins.
0: Lower-seeded team wins.
Bits 52–59: Regional Semifinals (Sweet Sixteen)
There are 8 games in the Sweet Sixteen, 2 games per region.
Bits 52–53: East Region Sweet Sixteen Games
Bit 52: Game 13: Winner of Game 9 vs Winner of Game 10
Bit 53: Game 14: Winner of Game 11 vs Winner of Game 12
Bits 54–55: Midwest Region Sweet Sixteen Games
Bit 54: Game 13: Winner of Game 9 vs Winner of Game 10
Bit 55: Game 14: Winner of Game 11 vs Winner of Game 12
Bits 56–57: South Region Sweet Sixteen Games
Bit 56: Game 13: Winner of Game 9 vs Winner of Game 10
Bit 57: Game 14: Winner of Game 11 vs Winner of Game 12
Bits 58–59: West Region Sweet Sixteen Games
Bit 58: Game 13: Winner of Game 9 vs Winner of Game 10
Bit 59: Game 14: Winner of Game 11 vs Winner of Game 12
Bit Value for Sweet Sixteen Games (Bits 52–59):
1: Higher-seeded team wins.
0: Lower-seeded team wins.
Bits 60–63: Regional Finals (Elite Eight)
There are 4 games in the Elite Eight, 1 game per region.
Bit 60: East Region Final
Game 15: Winner of Game 13 vs Winner of Game 14
Bit 61: Midwest Region Final
Game 15: Winner of Game 13 vs Winner of Game 14
Bit 62: South Region Final
Game 15: Winner of Game 13 vs Winner of Game 14
Bit 63: West Region Final
Game 15: Winner of Game 13 vs Winner of Game 14
Bit Value for Elite Eight Games (Bits 60–63):
1: Higher-seeded team wins.
0: Lower-seeded team wins.
Bits 64–65: Final Four Games
Bit 64: Semifinal Game 1 (involving the East Region Champion)
Bit Value:
1: East Region Champion wins.
0: East Region Champion loses.
Bit 65: Semifinal Game 2 (not involving the East Region Champion)
Bit Value:
1: The team that appears first in the region ordering wins.
0: The team that appears first in the region ordering loses.
Bit 66: Championship Game
Matchup: Winner of Semifinal Game 1 vs Winner of Semifinal Game 2
Bit Value:
1: Team from the region that comes first in the Region Order (East, Midwest, South, West) wins.
0: The other team wins.
Bits 67–71: Unused (set to 0)
Submission Guidelines
Before the Tournament
Prepare Your Bracket Files:
Generate your bracket files according to the specified format.
Ensure each file contains no more than 100 million brackets.
Compute SHA-256 Hashes:
Calculate the SHA-256 hash for each bracket file using the provided code or your own implementation.
Record the hashes in a text file (hashes.txt), one hash per line.
Submit Hashes:
Upload your hashes.txt file via the competition website.
Ensure the hashes are in the order you intend (affects tie-breakers).
After the Tournament
Make Your Winning Bracket File Available Online:
Upload the bracket file containing the perfect bracket to a publicly accessible URL (e.g., your website, GitHub, a file-sharing service).
Ensure that the file is accessible without authentication and can be downloaded directly.
Submit the URL and Hash via the Competition Website:
Log in to your account on the competition website.
Navigate to the Verify Winning Bracket page.
Fill out the form with:
The URL of your bracket file.
The SHA-256 hash of your bracket file.
Submit the form.
Verification Process:
The competition organizers will:
Verify that the provided hash exists in your submitted hashes.txt file.
Download your bracket file from the provided URL.
Verify that the hash matches the provided hash.
Check if the perfect bracket is present in your file.
Determine the winner based on the tie-breaker rules.