Skip to content

The solution of HashCode 2022 practice round with 3,882 points.

Notifications You must be signed in to change notification settings

hhkers/hashcode-2022-practice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Google HashCode 2022 Practice Round: One Pizza

My solution for Google HashCode 2022 Practice Round

Problem

You can find the problem statements here.

Solution

The codes for the solution are in Solve.ipynb and src.cpp.

The solution follows these steps:

  1. Processing (Solve.ipynb)

    1. Count likes, dislikes and calculate like - dislike for each ingredient.

    2. Include the ingredients greater than 0 in 1.

  2. Optimisation (src.cpp)

    1. Swap a random ingredient from "on the pizza" to "not on the pizza" and vice versa.

    2. Pick a random client that is currently not satisfied and swap ingredients to satisfy.

Results

File Score
A - An example 2
B - Basic 5
C - Coarse 5
D - Difficult 1,805
E - Elaborate 2,065
Total 3,882

With more optimisation, D and E might be improved.