/Hashcode-2017

My solution for the Google Hashcode 2017

Primary LanguagePHP

Google Hashcode 2017 - Online Qualification Round - Fabio Lombardo

In this repository you can find my solution for the Online Qualification Round at Google Hashcode 2017. Before looking into the code, I'd like to give you some context:

In the first moment, I registered to partecipate to the Google Hashcode with 3 other colleagues. However, for organizational reasons, me and another colleague decided to cancel our participation several days before the competition.

When the competition started (23th of February at 18.00) I was alone at home, and at 19.00 (one hour after the beginning) I decided to give a look at the problem statement. Fortunately I was already registered and the other colleague that cancelled was still in my same team, so I was able to change the team name and read the statement.
Since I had nothing better to do I decided to try to solve the problem, and unexpectedly it was simpler than I thought.

Without a team, in 3 hours instead of 4, I was able to submit a correct solution to all problems. If you ever tried to compete in Google Hashcode, you know that it's very difficult even to enter in the chart.

I classified:

1321° in the world rank (over 2815 that were able to post a correct solution)
73° in the Italian rank

Score World Rank Italian Rank

Obviously

The code is obviously not well structured, it was not meant to be elegant or readable, its only goal was to provide a correct solution in less than 3 hours. The only attention I paid was about the time complexity of the algorithms (one of the input files was very big, in the past Hashcode I wasn't able to give the solution for the biggest file since the time needed for the computation was several hours)

Content of the repository:

Folders:

statement Contains the problem statement

input contains the input data provided by Google

screenshots some screenshots and rank certificate

output my output files

solutions the actual code I used for the solutins