Git Product home page Git Product logo

hashcode_2021's Introduction

hashcode_2021

Google Hash Code 2021

The description of the problem can be found in this file: hashcode_2021_online_qualifications.pdf

codit-21 Team Members

Input/Output files

In the folder named input files you can find the input data provided by Google.
Given those files, after certain calculations our program prints the results in the desired format. Those results can be found in the folder named output files.
Each .txt file in input files has a corresponding .txt file in output files.

Program source code and compilation

The code for our solution can be found in final.cc. It can be compiled by g++ compiler using the command g++ final.cc -o final.
Then you can run the executable file providing an input file and a destination file for the output. For example, the command for executing the program with a.txt as input file (and exporting results in a_results.txt) would be ./final < ./input\ files/a.txt > ./output\ files/a_result.txt.

Algorithm description

Streets are sorted based on points which are equal to the amount of cars they are intially going to have in descending order. Then, they are divided into three caterories by taking into consideration their amount of points and comparing them with naively chosen numbers. This way, streets with the most cars have a green traffic light on for 3 seconds. Streets with the fewest cars have their green traffic light on for only 1 second, while streets with an average amount of cars get 2 seconds.

We managed to score 8,148,907 points and rank position 3683 globally!

hashcode_2021's People

Contributors

dejvidb avatar tech-gian avatar theofrag avatar

Forkers

tech-gian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.