{"id":16515544,"url":"https://github.com/linnykoleh/googlehashcode","last_synced_at":"2026-02-19T06:31:04.077Z","repository":{"id":77677891,"uuid":"82950671","full_name":"linnykoleh/GoogleHashCode","owner":"linnykoleh","description":"Google Hashcode 2017 Streaming videos ","archived":false,"fork":false,"pushed_at":"2017-03-10T06:24:34.000Z","size":5651,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-16T19:19:41.540Z","etag":null,"topics":["2017","google","hashcode-2017","online","qualification","round","streaming","videos"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linnykoleh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-02-23T17:04:38.000Z","updated_at":"2018-02-23T13:07:15.000Z","dependencies_parsed_at":"2023-05-05T06:20:18.334Z","dependency_job_id":null,"html_url":"https://github.com/linnykoleh/GoogleHashCode","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/linnykoleh/GoogleHashCode","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnykoleh%2FGoogleHashCode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnykoleh%2FGoogleHashCode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnykoleh%2FGoogleHashCode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnykoleh%2FGoogleHashCode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linnykoleh","download_url":"https://codeload.github.com/linnykoleh/GoogleHashCode/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linnykoleh%2FGoogleHashCode/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29604767,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T05:11:50.834Z","status":"ssl_error","status_checked_at":"2026-02-19T05:11:38.921Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2017","google","hashcode-2017","online","qualification","round","streaming","videos"],"created_at":"2024-10-11T16:17:30.913Z","updated_at":"2026-02-19T06:31:04.072Z","avatar_url":"https://github.com/linnykoleh.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![alt text](src/main/resources/images/Screenshot1.png)\n\n**Visualization result of our submission**\n\n_Kittens_\n![alt text](src/main/resources/images/visualization/hashcode.png)\n\n_Trending today_\n![alt text](src/main/resources/images/visualization/hashcode1.png)\n\n_Me at the zoo_\n![alt text](src/main/resources/images/visualization/hashcode.png)\n\n\n**Introduction**\n\nHave you ever wondered what happens behind the scenes when you watch a YouTube video? As more\nand more people watch online videos (and as the size of these videos increases), it is critical that\nvideo-serving infrastructure is optimized to handle requests reliably and quickly.\n\nThis typically involves putting in place cache servers, which store copies of popular videos. When a user\nrequest for a particular video arrives, it can be handled by a cache server close to the user, rather than by a\nremote data center thousands of kilometers away.\n\nBut how should you decide which videos to put in which cache servers?\n\n**Task**\n\nGiven a description of cache servers, network endpoints and videos, along with predicted requests for\nindividual videos, decide which videos to put in which cache server in order to minimize the average\nwaiting time for all requests.\n\n**Problem description**\n\nThe picture below represents the video serving network.\n\n![alt text](src/main/resources/images/Screenshot2.png)\n\n**Videos**\n\nEach video has a size given in megabytes (MB). The data center stores all videos​. Additionally, each video\ncan be put in 0, 1, or more cache servers​. Each cache server has a maximum capacity given in\nmegabytes.\n\n**Endpoints**\n\nEach endpoint ​represents a group of users connecting to the Internet in the same geographical area (for\nexample, a neighborhood in a city). Every endpoint is connected to the data center. Additionally, each\nendpoint may (but doesn’t have to) be connected to 1 or more cache servers.\nEach endpoint is characterized by the latency of its connection to the data center (how long it takes to serve\na video from the data center to a user in this endpoint), and by the latencies to each cache server that the\nendpoint is connected to (how long it takes to serve a video stored in the given cache server to a user in\nthis endpoint).\n\n**Requests**\n\nThe predicted requests provide data on how many times a particular video is requested from a particular\nendpoint.\n\n**Input data set**\n\nThe input data is provided as a data set file - a plain text file containing exclusively ASCII characters with a\nsingle ‘\\n’ character at the end of each line (UNIX-style line endings).\nVideos, endpoints and cache servers are referenced by integer IDs. There are V videos numbered from 0\nto V − 1 , E endpoints numbered from 0 to E − 1 and C cache servers numbered from 0 to C − 1 .\n\nThe first line of the input contains the following numbers:   \n   + V​ (1 ≤ V ≤ 10000) - the number of videos\n   + E (1 ≤ E ≤ 1000) - the number of endpoints\n   + R (1 ≤ R ≤ 1000000) - the number of request descriptions\n   + C (1 ≤ C ≤ 1000) - the number of cache servers\n   + X (1 ≤ X ≤ 500000) - the capacity of each cache server in megabytes\n\nThe next line contains V​ numbers describing the sizes of individual videos in megabytes: S , , .. S . 0 S1. V −1\nS is the size of video i in megabytes i (1 ≤ S 000) i ≤ 1\n\nThe next section describes each of the endpoints one after another, from endpoint 0 to endpoint E − 1 . The\ndescription of each endpoint consists of the following lines:\n\n + a line containing two numbers:\n      +  L​D (2 ≤ L 000) - the latency of serving a video request from the data center to this D ≤ 4\nendpoint, in milliseconds\n      + K​ (0 ≤ K ≤ C) - the number of cache servers that this endpoint is connected to\n + K lines describing the connections from the endpoint to each of the K connected cache servers.\nEach line contains the following numbers:\n      + c​ (0 ≤ c \u003c C) - the ID of the cache server\n      + L​c (1 ≤ Lc ≤ 500) - the latency of serving a video request from this cache server to this\nendpoint, in milliseconds. You can assume that latency from the cache is strictly lower than\nlatency from the data center (1 ≤ Lc \u003c L ) . \n\n\nFinally, the last section contains R ​request descriptions in separate lines. Each line contains the following\nnumbers:\n+ R​v​ (0 ≤ Rv \u003c V ) - the ID of the requested video\n+ R​e​ (0 ≤ Re \u003c E) - the ID of the endpoint from which the requests are coming from\n+ R​n​ (0 \u003c Rn ≤ 10000) - the number of requests\n\n![alt text](src/main/resources/images/Screenshot3.png)\n\n**Connections and latencies between the endpoints and caches of example input**\n\n**Submissions**\n\n**File format**\n\nYour submission should start with a line containing a single number N ( 0 ≤ N ≤ C ) - the number of cache\nserver descriptions to follow.\n\nEach of the subsequent N lines should describe the videos cached in a single cache server. It should\ncontain the following numbers:\n+ c​ (0 ≤ c \u003c C) - the ID of the cache server being described,\n+ the IDs of the videos stored in this cache server: v0, ... , vn (0 ≤ vi \u003c V ) (at least 0 and at most V numbers), given in any order without repetitions\n\nEach cache server should be described in at most one line. It is not necessary to describe all cache\nservers: if a cache does not occur in the submission, this cache server will be considered as empty. Cache\nservers can be described in any order.\n\n![alt text](src/main/resources/images/Screenshot4.png)\n\n**Validation**\n\nThe output file is valid if it meets the following criteria:\n+ the format matches the description above\n+ the total size of videos stored in each cache server does not exceed the maximum cache server capacity\n\n**Scoring**\n\nThe score is the average time saved per request, in microseconds. (Note that the latencies in the input file\nare given in milliseconds. The score is given in microseconds to provide a better resolution of results.)\nFor each request description in the input file, we choose the best way to stream the video R​v\n(Rv, Re, Rn) to the endpoint R​e​. We pick the lowest possible latency , where LD L = min(L , , .. , ) is the latency of D L0. Lk−1\nserving a video to the endpoint R​e from the data center, and L0, ... , Lk−1 are latencies of serving a video to\nthe endpoint R​e ​ from each cache server that:\n\n+ is connected to the endpoint R​e​, and\n+ contains the video R​v\n\nThe time that was saved for each request is LD − L (This is the time it would take to stream the video from\nthe data center, minus the time it actually took. If the video is in fact streamed from the data center, the time\nsaved is 0.)\n\nAs each request description describes R​n\nrequests, the time saved for the entire request description is Rn × (L ) . D − L\n\nTo compute the total score for the data set, we sum the time saved for individual request descriptions in\nmilliseconds, multiply by 1000 and divide it by the total number of requests in all request descriptions,\nrounding down.\n\n![alt text](src/main/resources/images/Screenshot5.png)\n\n![alt text](src/main/resources/images/Screenshot6.png)\n\n_© Google 2017, All rights reserved._\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinnykoleh%2Fgooglehashcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinnykoleh%2Fgooglehashcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinnykoleh%2Fgooglehashcode/lists"}