My solution for Google HashCode 2022 Practice Round
You can find the problem statements here.
The codes for the solution are in Solve.ipynb and src.cpp.
The solution follows these steps:
-
Processing (Solve.ipynb)
-
Count
likes
,dislikes
and calculatelike - dislike
for each ingredient. -
Include the ingredients greater than
0
in 1.
-
-
Optimisation (src.cpp)
-
Swap a random ingredient from "on the pizza" to "not on the pizza" and vice versa.
-
Pick a random client that is currently not satisfied and swap ingredients to satisfy.
-
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.